*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --bg:           #F4F3F1;
            --nexBackground: #1a2036;
            --surface:      #FFFFFF;
            --border:       #E2E0DC;
            --border-focus: #9A9590;
            --text-1:       #1A1917;
            --text-2:       #6B6860;
            --text-3:       #A5A39F;
            --accent:       #1A1917;
            --danger:       #C0392B;
            --radius-sm:    5px;
            --radius:       8px;
            --radius-lg:    12px;
            --transition:   0.18s ease;
            --nexPrimary:   #57fbb1;
        }

        html, body { height: 100%; font-family: 'Geist', sans-serif; background: var(--nexBackground); color: var(--text-1); }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background-image: linear-gradient(rgba(255, 255, 255, 1%) 1px, transparent 3px), linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
            background-size: 80px 80px;
            pointer-events: none;
            z-index: 0;
        }

        /* ── Brand bar ── */
        .brand-bar {
            position: fixed; top: 0; left: 0; right: 0; height: 52px;
            background: rgba(244,243,241,0.88);
            backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
            border-bottom: 1px solid var(--border);
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 28px; z-index: 100;
        }

        .brand { display: flex; align-items: center; gap: 9px; }

        .brand-mark {
            width: 28px; height: 28px;
            background: var(--text-1); border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
        }

        .brand-mark svg { width: 15px; height: 15px; fill: #fff; }

        .brand-name {
            font-family: 'Instrument Serif', serif;
            letter-spacing: 15px;
            font-size: 30px;
            font-weight: 600;
            color: var(--nexBackground);
            /* text-shadow: 0 0 4px white; */
        }

        .brand-tagline { 
            font-size: 11px; 
            color: var(--text-1); 
            letter-spacing: 0.04em; 
            text-transform: uppercase;
         }

        /* ── Page ── */
        .page {
            min-height: 100vh;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            padding: 40px 20px;
            position: relative; z-index: 1;
        }

        /* ── Card ── */
        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 16px 48px rgba(0,0,0,0.07);
            width: 100%; max-width: 400px;
            padding: 36px 36px 30px;
            margin-top: 52px;
            animation: rise 0.38s cubic-bezier(0.22,1,0.36,1) both;
        }

        @keyframes rise {
            from { opacity: 0; transform: translateY(14px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ── Card head ── */
        .card-head { margin-bottom: 26px; }

        .card-head h1 {
            font-family: 'Instrument Serif', serif;
            font-size: 25px; font-weight: 400;
            color: var(--text-1); line-height: 1.2; margin-bottom: 4px;
        }

        .card-head p { font-size: 13px; color: var(--text-2); }

        /* ── Tabs ── */
        .tabs {
            display: flex; border-bottom: 1px solid var(--border);
            margin-bottom: 26px;
        }

        .tab-btn {
            flex: 1; padding: 8px 4px 11px;
            border: none; background: transparent;
            font-family: 'Geist', sans-serif;
            font-size: 13px; font-weight: 500;
            color: var(--text-3); cursor: pointer;
            transition: color var(--transition);
            border-bottom: 2px solid transparent; margin-bottom: -1px;
        }

        .tab-btn.active { color: var(--text-1); border-bottom-color: var(--text-1); }
        .tab-btn:hover:not(.active) { color: var(--text-2); }

        /* ── Auth forms ── */
        .auth-form { display: none; }
        .auth-form.active { display: block; animation: fadeIn 0.2s ease; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        /* ── Fields ── */
        .field { margin-bottom: 13px; }

        .field label {
            display: block; font-size: 11px; font-weight: 600;
            color: var(--text-2); text-transform: uppercase;
            letter-spacing: 0.08em; margin-bottom: 6px;
        }

        .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

        input[type="text"],
        input[type="email"],
        input[type="password"] {
            width: 100%; height: 40px;
            padding: 0 12px;
            border: 1px solid var(--border); border-radius: var(--radius-sm);
            background: var(--bg);
            font-family: 'Geist', sans-serif; font-size: 14px; color: var(--text-1);
            transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
            outline: none;
        }

        input::placeholder { color: var(--text-3); }

        input:focus {
            border-color: var(--border-focus); background: #fff;
            box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
        }

        input.invalid {
            border-color: var(--danger);
            box-shadow: 0 0 0 3px rgba(192,57,43,0.08);
        }

        .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

        /* ── Login extras ── */
        .login-extras {
            display: flex; justify-content: space-between; align-items: center;
            margin: 4px 0 20px;
        }

        .remember {
            display: flex; align-items: center; gap: 6px;
            font-size: 12.5px; color: var(--text-3);
            cursor: default; user-select: none;
        }

        #forgot-password {
            font-size: 12.5px; color: var(--text-2);
            text-decoration: none; transition: color var(--transition);
        }

        #forgot-password:hover { color: var(--text-1); }

        /* ── Company note ── */
        .company-note {
            display: flex; align-items: flex-start; gap: 9px;
            background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 20px;
        }

        .company-note i { color: var(--text-3); font-size: 12px; margin-top: 1px; flex-shrink: 0; }
        .company-note p { font-size: 12px; color: var(--text-2); line-height: 1.5; }

        /* ── Section label ── */
        .section-label {
            font-size: 10.5px; font-weight: 600; text-transform: uppercase;
            letter-spacing: 0.1em; color: var(--text-3);
            margin: 18px 0 13px;
            display: flex; align-items: center; gap: 10px;
        }

        .section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

        /* ── Submit ── */
        .btn-submit {
            width: 100%; height: 42px;
            background: var(--text-1); color: #fff;
            border: none; border-radius: var(--radius-sm);
            font-family: 'Geist', sans-serif; font-size: 13.5px; font-weight: 500;
            cursor: pointer; letter-spacing: 0.01em; margin-top: 16px;
            transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
        }

        .btn-submit:hover {
            background: #333230;
            box-shadow: 0 4px 16px rgba(0,0,0,0.18);
            transform: translateY(-1px);
        }

        .btn-submit:active { transform: translateY(0); box-shadow: none; }
        .btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

        /* ── Recovery links ── */
        .recovery-links {
            display: flex; justify-content: space-between; align-items: center;
            gap: 12px; margin-top: 16px;
        }

        .recovery-links a {
            font-size: 12.5px; color: var(--text-2);
            text-decoration: none; transition: color var(--transition);
        }

        .recovery-links a:hover { color: var(--text-1); }
        .recovery-links a:only-child { margin-left: auto; }

        /* ── Card footer ── */
        .card-footer {
            margin-top: 22px;
            padding-top: 18px;
            border-top: 1px solid var(--border);
            text-align: center;
            font-size: 11.5px;
            color: var(--text-2);
        }

        .card-footer a {
            color: var(--nexBackground);
            text-decoration: none;
        }
        .card-footer a:hover { color: var(--text-1); }

        /* ── Module chips ── */
        .modules-hint {
            margin-top: 18px;
            display: flex; align-items: center; justify-content: center;
            gap: 8px; flex-wrap: wrap;
        }

        .mod-chip {
            font-size: 11px; 
            color: var(--text-1);
            background: var(--surface); border: 1px solid var(--border);
            border-radius: 20px; padding: 3px 10px;
        }

        /* ── Responsive ── */
        @media (max-width: 480px) {
            .card { 
                padding: 28px 20px 24px; 
            }
            .field-row { 
                grid-template-columns: 1fr; 
            }
            .brand-tagline { 
                display: none; 
            }

            .brand-bar {
                padding: 0 16px;
                text-align: center;
                justify-content: center;
            }
            .brand-name { 
                font-size: 24px; 
                letter-spacing: 10px; 
            }
        }