*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --accent:      #c902e3;
            --accent-rgb:  201, 2, 227;
            --gold:        #ffd700;
            --card-bg:     rgba(255,255,255,0.06);
            --card-border: rgba(255,255,255,0.1);
            --input-bg:    rgba(255,255,255,0.07);
            --input-border:rgba(255,255,255,0.15);
            --text:        #ffffff;
            --text-soft:   rgba(255,255,255,0.65);
            --text-muted:  rgba(255,255,255,0.35);
        }

        ::-webkit-scrollbar { width: 4px; }
        ::-webkit-scrollbar-thumb { background: #3d0070; border-radius: 4px; }

        html, body { height: 100%; font-family: 'Poppins', sans-serif; color: var(--text); }

        body {
            background:
                radial-gradient(ellipse 80% 55% at 50% 0%, #5a0fa0 0%, transparent 60%),
                radial-gradient(ellipse 55% 40% at 10% 80%, #3d0070 0%, transparent 55%),
                radial-gradient(ellipse 45% 35% at 90% 80%, #2d0060 0%, transparent 55%),
                radial-gradient(ellipse 100% 100% at 50% 50%, #140025 0%, #06000e 100%);
            background-attachment: fixed;
            display: flex; align-items: flex-start; justify-content: center;
            padding: 12px 12px 16px;
            overflow-x: hidden;
            position: relative;
        }

        body::before {
            content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
            background-image:
                radial-gradient(1px 1px at 8%  12%, rgba(255,215,0,0.7) 0%, transparent 100%),
                radial-gradient(1px 1px at 22% 38%, rgba(255,255,255,0.5) 0%, transparent 100%),
                radial-gradient(1.5px 1.5px at 37% 7%, rgba(255,215,0,0.5) 0%, transparent 100%),
                radial-gradient(1px 1px at 55% 20%, rgba(255,255,255,0.4) 0%, transparent 100%),
                radial-gradient(2px 2px at 67%  4%, rgba(255,215,0,0.6) 0%, transparent 100%),
                radial-gradient(1px 1px at 80% 32%, rgba(255,255,255,0.5) 0%, transparent 100%),
                radial-gradient(1px 1px at 14% 63%, rgba(255,255,255,0.3) 0%, transparent 100%),
                radial-gradient(1px 1px at 45% 87%, rgba(255,215,0,0.5) 0%, transparent 100%),
                radial-gradient(2px 2px at 72% 75%, rgba(255,255,255,0.4) 0%, transparent 100%),
                radial-gradient(2px 2px at 95% 54%, rgba(255,215,0,0.6) 0%, transparent 100%);
            animation: twinkle 4s ease-in-out infinite alternate;
        }
        @keyframes twinkle { 0% { opacity:0.5; } 100% { opacity:1; } }

        #particle-canvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

        .card {
            position: relative; z-index: 10;
            background: var(--card-bg);
            border: 1px solid var(--card-border);
            border-radius: 16px;
            padding: 14px 16px 12px;
            width: 100%; max-width: 390px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            animation: cardIn 0.6s cubic-bezier(0.22,1,0.36,1) both;
        }
        @keyframes cardIn {
            from { opacity:0; transform: translateY(30px) scale(0.97); }
            to   { opacity:1; transform: translateY(0) scale(1); }
        }

        .logo-area {
            display: flex; align-items: center; gap: 9px;
            margin-bottom: 8px;
        }
        .logo-ring {
            width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
            background: conic-gradient(from 0deg, var(--gold), var(--accent), var(--gold));
            padding: 2px; display: flex; align-items: center; justify-content: center;
            box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55), 0 0 28px rgba(255,215,0,0.2);
            animation: ringRotate 6s linear infinite;
        }
        @keyframes ringRotate { to { filter: hue-rotate(360deg); } }
        .logo-inner {
            width: 100%; height: 100%; border-radius: 50%;
            background: #1a0030;
            display: flex; align-items: center; justify-content: center; overflow: hidden;
        }
        .logo-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .logo-inner i   { font-size: 15px; color: var(--gold); }
        .logo-text { flex: 1; min-width: 0; }
        .site-title { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
        .site-sub   { font-size: 10px; color: var(--text-muted); }

        .referrer-badge {
            display: flex; align-items: center; gap: 5px;
            background: rgba(var(--accent-rgb), 0.08);
            border: 1px solid rgba(var(--accent-rgb), 0.18);
            border-radius: 5px; padding: 3px 7px; margin-bottom: 6px;
            font-size: 11px; color: var(--text-soft);
        }
        .referrer-badge.default { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
        .ref-icon {
            width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0;
            background: var(--accent);
            display: flex; align-items: center; justify-content: center;
            font-size: 8px; color: #fff;
        }
        .referrer-badge.default .ref-icon { background: rgba(255,255,255,0.1); }
        .ref-inline strong { color: var(--text); font-weight: 600; }

        .login-notice {
            display: flex; align-items: center; gap: 5px;
            background: rgba(255,215,0,0.05); border: 1px solid rgba(255,215,0,0.15);
            border-radius: 5px; padding: 3px 7px; margin-bottom: 8px;
            font-size: 10.5px; color: rgba(255,215,0,0.7);
        }
        .login-notice i { font-size: 9px; color: var(--gold); flex-shrink: 0; }

        .field { margin-bottom: 7px; }
        label {
            display: block; font-size: 10.5px; font-weight: 600;
            color: var(--text-soft); margin-bottom: 3px; letter-spacing: 0.2px;
        }

        .input-wrap { position: relative; }

        input[type="text"],
        input[type="email"],
        input[type="tel"],
        input[type="password"],
        select {
            width: 100%; height: 38px; padding: 0 32px 0 10px;
            background: var(--input-bg); border: 1.5px solid var(--input-border);
            border-radius: 8px; font-family: 'Poppins', sans-serif;
            font-size: 12.5px; color: var(--text); outline: none;
            transition: border-color 0.15s, box-shadow 0.15s; appearance: none;
        }
        input::placeholder { color: var(--text-muted); font-size: 12px; }
        input:focus, select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
        }
        #password { padding-right: 56px; }

        input.f-valid   { border-color: #22c55e; background: rgba(34,197,94,0.06); }
        input.f-invalid, select.f-invalid { border-color: #ef4444; background: rgba(239,68,68,0.06); }
        input.f-checking { border-color: #f59e0b; }
        input.f-valid:focus   { box-shadow: 0 0 0 2px rgba(34,197,94,0.18); }
        input.f-invalid:focus { box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }

        .select-wrap { position: relative; }
        .select-wrap::after {
            content: ''; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
            border-left: 4px solid transparent; border-right: 4px solid transparent;
            border-top: 5px solid rgba(255,255,255,0.35); pointer-events: none;
        }
        select option { background: #1a0030; color: #fff; }

        .f-status {
            position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
            font-size: 12px; pointer-events: none; display: none; line-height: 1;
        }
        .pw-status { right: 30px; }

        .f-msg {
            font-size: 10px; font-weight: 500; margin-top: 2px;
            max-height: 0; overflow: hidden;
            display: flex; align-items: center; gap: 3px; transition: max-height 0.15s;
        }
        .f-msg.show { max-height: 20px; }
        .f-msg.ok   { color: #4ade80; }
        .f-msg.err  { color: #f87171; }
        .f-msg.chk  { color: #fbbf24; }

        @keyframes spin-icon { to { transform: rotate(360deg); } }
        .spin-anim { display: inline-block; animation: spin-icon 0.7s linear infinite; }

        .toggle-pwd {
            position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
            background: none; border: none; cursor: pointer;
            color: var(--text-muted); font-size: 12px; padding: 2px;
        }
        .toggle-pwd:hover { color: var(--gold); }

        .field-row { display: block; margin-bottom: 0; }
        .field-row .field { margin-bottom: 7px; }

        .form-divider {
            height: 1px; margin: 6px 0 7px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        }

        .terms-box {
            border: 1.5px solid var(--input-border); border-radius: 7px;
            padding: 6px 9px; margin-bottom: 8px; background: var(--input-bg);
        }
        .terms-box.error { border-color: #ef4444; background: rgba(239,68,68,0.06); }
        .terms-box:focus-within { border-color: var(--accent); }
        .terms-row { display: flex; align-items: flex-start; gap: 8px; }
        .terms-row input[type="checkbox"] {
            width: 13px; height: 13px; min-width: 13px;
            margin-top: 2px; accent-color: var(--accent); cursor: pointer;
        }
        .terms-text { font-size: 11px; color: var(--text-soft); line-height: 1.5; }
        .terms-text a {
            color: var(--gold); font-weight: 600; text-decoration: none;
            border-bottom: 1px solid rgba(255,215,0,0.25);
        }

        .btn {
            width: 100%; height: 40px; background: var(--accent);
            color: #fff; border: none; border-radius: 9px;
            font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 700;
            cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
            box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4);
        }
        .btn:hover:not(:disabled) { filter: brightness(1.08); }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; }

        .spinner {
            display: none; width: 15px; height: 15px;
            border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
            border-radius: 50%; animation: spin 0.6s linear infinite;
        }
        .btn.loading .btn-label { display: none; }
        .btn.loading .spinner   { display: block; }
        @keyframes spin { to { transform: rotate(360deg); } }

        .card-footer {
            text-align: center; margin-top: 9px;
            font-size: 11.5px; color: var(--text-muted);
        }
        .card-footer a { color: var(--gold); text-decoration: none; font-weight: 600; }
        .copy-line {
            text-align: center; margin-top: 8px; padding-top: 8px;
            border-top: 1px solid rgba(255,255,255,0.07);
            font-size: 9.5px; color: rgba(255,255,255,0.18);
        }

        /* ── Errors banner ── */
        .errors-banner {
            background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2);
            border-left: 3px solid #ef4444; border-radius: 9px;
            padding: 10px 12px; margin-bottom: 10px;
        }
        .errors-banner li {
            font-size: 11.5px; color: #fca5a5; font-weight: 500;
            list-style: none; display: flex; align-items: center; gap: 5px;
            margin-bottom: 3px;
        }
        .errors-banner li:last-child { margin-bottom: 0; }
        .errors-banner li::before { content: '✕'; font-size: 10px; flex-shrink: 0; }

        /* Modal */
        .modal-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.6); z-index: 9999;
            align-items: center; justify-content: center; padding: 14px;
            backdrop-filter: blur(4px);
        }
        .modal-overlay.open { display: flex; }
        .modal {
            background: #1a0030; border: 1px solid rgba(255,215,0,0.2);
            border-radius: 14px; max-width: 390px; width: 100%; max-height: 88vh;
            display: flex; flex-direction: column;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        }
        .modal-head {
            display: flex; align-items: center; justify-content: space-between;
            padding: 13px 16px 11px; border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .modal-head h3 { font-size: 13.5px; font-weight: 700; color: var(--gold); }
        .modal-close {
            width: 26px; height: 26px; border-radius: 6px;
            background: rgba(255,255,255,0.08); border: none; cursor: pointer;
            font-size: 16px; color: var(--text-soft);
            display: flex; align-items: center; justify-content: center;
        }
        .modal-body { overflow-y: auto; padding: 14px 16px; flex: 1; }
        .terms-section { margin-bottom: 12px; }
        .terms-section h4 {
            font-size: 10px; font-weight: 700; color: var(--gold);
            text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
        }
        .terms-section p { font-size: 11.5px; color: var(--text-soft); line-height: 1.6; }
        .terms-highlight {
            background: rgba(255,215,0,0.05); border: 1px solid rgba(255,215,0,0.18);
            border-radius: 8px; padding: 10px 12px;
        }
        .modal-foot {
            padding: 10px 16px 14px; border-top: 1px solid rgba(255,255,255,0.08);
            display: flex; gap: 8px;
        }
        .btn-accept {
            flex: 1; height: 38px; background: var(--accent); color: #fff;
            border: none; border-radius: 8px; font-family: 'Poppins', sans-serif;
            font-size: 12.5px; font-weight: 700; cursor: pointer;
        }
        .btn-accept:hover { filter: brightness(1.08); }
        .btn-decline {
            height: 38px; padding: 0 13px; background: rgba(255,255,255,0.07);
            color: var(--text-soft); border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px; font-family: 'Poppins', sans-serif;
            font-size: 12.5px; font-weight: 500; cursor: pointer;
        }

        /* Toast */
        .toast {
            position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
            min-width: 280px; max-width: 88%;
            background: #1e0038; border: 1px solid rgba(255,255,255,0.1);
            border-radius: 11px; padding: 10px 36px 10px 11px;
            box-shadow: 0 8px 28px rgba(0,0,0,0.45);
            z-index: 10000; display: flex; align-items: center; gap: 9px;
            transition: top 0.3s ease;
        }
        .toast.show { top: 14px; }
        .toast-icon { width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 9px; color: #fff; }
        .toast.success { border-left: 3px solid #22c55e; }
        .toast.error   { border-left: 3px solid #ef4444; }
        .toast.success .toast-icon { background: #22c55e; }
        .toast.error   .toast-icon { background: #ef4444; }
        .toast-msg { font-size: 12px; color: var(--text); font-weight: 500; flex: 1; }
        .toast-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 14px; color: var(--text-muted); cursor: pointer; }

        @media (max-width: 380px) { .card { padding: 12px 13px 11px; } }
    