/* ==============================
   register.css
   Aligned with styles.css design system
============================== */


/* ==============================
   1. RESET & GLOBAL
============================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: #0b0b0f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 20% 20%, #111827 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, #1e1b4b 0%, transparent 40%),
        #0b0b0f;
    color: white;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}


/* ==============================
   2. HEADER
   (matches .app-header in styles.css)
============================== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 30px;
    background: linear-gradient(to right, #0f111a, #111827);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.brand-block:hover .brand-logo {
    filter: brightness(1.2);
}

.brand-icon {
    width: 42px;
    height: 42px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    letter-spacing: 0.5px;
}

.brand-tagline {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
    margin-top: -4px;
}

.header-link {
    font-size: 13px;
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.header-link:hover {
    color: white;
}

.header-link strong {
    color: #0ea5e9;
}


/* ==============================
   3. PAGE LAYOUT
============================== */

.page-wrap {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px 64px;
}

/* Register card — extends .card from styles.css */
.register-card {
    width: 100%;
    max-width: 560px;
    background: #14141a;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
    animation: modalFade 0.3s ease-out both;
}

@keyframes modalFade {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ==============================
   4. CARD HEADER
============================== */

.card-header {
    padding: 32px 40px 26px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(147,51,234,0.06), rgba(236,72,153,0.04));
    pointer-events: none;
}

.card-header-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
    margin: 0 0 6px;
}

.card-header p {
    font-size: 13px;
    color: #aaa;
    margin: 0;
    line-height: 1.5;
}


/* ==============================
   5. CARD BODY & FORM GRID
============================== */

.card-body {
    padding: 30px 40px 36px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group.full {
    grid-column: 1 / -1;
}

/* Labels — matches .section-title pattern */
.form-group > label:first-child {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}


/* ==============================
   6. INPUTS
   (matches .modal-content input from styles.css)
============================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
    -webkit-appearance: none;
}

input::placeholder {
    color: rgba(255,255,255,0.35);
}

input:hover,
select:hover {
    border-color: rgba(255,255,255,0.15);
}

input:focus,
select:focus {
    border-color: rgba(147,51,234,0.6);
    box-shadow:
        0 0 0 3px rgba(147,51,234,0.2),
        0 8px 24px rgba(147,51,234,0.1);
}

input.error  { border-color: #f87171; }
input.success { border-color: #10b981; }

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
}

select option {
    background: #1e1e26;
}


/* ==============================
   7. PASSWORD WRAP & TOGGLE
============================== */

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 42px;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px;
    transition: color 0.2s;
}

.toggle-pw:hover {
    color: rgba(255,255,255,0.8);
}


/* ==============================
   8. PASSWORD STRENGTH METER
============================== */

.strength-bar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.strength-bar span {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.08);
    transition: background 0.3s;
}

.strength-bar[data-level="1"] span:nth-child(1)    { background: #f87171; }
.strength-bar[data-level="2"] span:nth-child(-n+2) { background: #f59e0b; }
.strength-bar[data-level="3"] span:nth-child(-n+3) { background: #0ea5e9; }
.strength-bar[data-level="4"] span                 { background: #10b981; }

.strength-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    height: 14px;
    transition: color 0.2s;
}


/* ==============================
   9. FIELD HINT & ERROR
============================== */

.field-hint {
    font-size: 12px;
    opacity: 0.5;
    margin-top: 6px;
    line-height: 1.4;
}

.field-error {
    font-size: 12px;
    color: #f87171;
    margin-top: 5px;
    display: none;
}


/* ==============================
   10. GENDER PILLS
   (custom radio — matches report-options style)
============================== */

.gender-pills {
    display: flex;
    gap: 10px;
}

.gender-pills input[type="radio"] {
    display: none;
}

.gender-pills label {
    flex: 1;
    text-align: center;
    padding: 11px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s ease;
}

.gender-pills label:hover {
    background: rgba(147,51,234,0.08);
    border-color: rgba(147,51,234,0.3);
}

.gender-pills input[type="radio"]:checked + label {
    border-color: rgba(147,51,234,0.6);
    background: rgba(147,51,234,0.12);
    color: #c4b5fd;
}


/* ==============================
   11. SECTION DIVIDER
============================== */

.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    grid-column: 1 / -1;
    margin: 8px 0 6px;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.05);
}

.form-divider span {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}


/* ==============================
   12. AGE NOTICE
============================== */

.age-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(248,113,113,0.06);
    border: 1px solid rgba(248,113,113,0.15);
    border-radius: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: rgba(252,165,165,0.85);
    line-height: 1.5;
}

.age-notice::before {
    content: '⚠️';
    font-size: 14px;
    flex-shrink: 0;
}


/* ==============================
   13. TERMS ROW
============================== */

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
}

.terms-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
    accent-color: #9333ea;
    cursor: pointer;
}

.terms-row span {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
}

.terms-row a {
    color: #0ea5e9;
    text-decoration: none;
}

.terms-row a:hover {
    text-decoration: underline;
}


/* ==============================
   14. FORM ALERT (global error)
============================== */

.form-alert {
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    color: #f87171;
    font-size: 13px;
    margin-top: 18px;
    display: none;
}

.form-alert.show {
    display: block;
}


/* ==============================
   15. SUBMIT BUTTON
   (extends .modal-submit from styles.css)
============================== */

.submit-btn {
    width: 100%;
    padding: 15px;
    margin-top: 22px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #9333ea, #ec4899);
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 10px 25px rgba(147,51,234,0.25);
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.15), transparent 70%);
    transform: translateX(-100%);
    transition: 0.6s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(147,51,234,0.35);
}

.submit-btn:hover::after {
    transform: translateX(100%);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.submit-btn.loading .btn-text    { display: none; }
.submit-btn.loading .btn-spinner { display: block; }


/* ==============================
   16. SIGN-IN ROW
============================== */

.signin-row {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    opacity: 0.7;
}

.signin-row a {
    color: #0ea5e9;
    font-weight: 600;
    text-decoration: none;
}

.signin-row a:hover {
    text-decoration: underline;
}


/* ==============================
   17. SUCCESS SCREEN
============================== */

.success-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 52px 40px;
    gap: 14px;
}

.success-screen.show {
    display: flex;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16,185,129,0.12);
    border: 2px solid #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    animation: popIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275) both;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.success-screen h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.4px;
    background: linear-gradient(45deg, #9333ea, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.success-screen p {
    font-size: 14px;
    color: #aaa;
    max-width: 300px;
    line-height: 1.6;
}

.success-screen p strong {
    color: white;
}

.verify-note {
    font-size: 12px !important;
    opacity: 0.55;
}

/* Reuse .go-btn pattern from styles.css */
.success-screen a {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    background: #0ea5e9;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.success-screen a:hover {
    background: #0284c7;
}


/* ==============================
   18. FOOTER
   (matches .site-footer from styles.css)
============================== */

.site-footer {
    padding: 28px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(to top, #0b0b0f, #0f111a);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.site-footer a {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #0ea5e9;
}

.site-footer .sep {
    color: rgba(255,255,255,0.1);
}


/* ==============================
   19. CAPTCHA STEP
============================== */

.captcha-step {
    display: flex;
    flex-direction: column;
    padding: 10px 0 8px;
    animation: modalFade 0.22s ease-out both;
}

.captcha-back {
    margin-bottom: 16px;
}

.back-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
    letter-spacing: 0.2px;
}

.back-btn:hover {
    color: white;
}

.captcha-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 10px 0 20px;
}

.captcha-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 4px;
}

.captcha-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(45deg, #9333ea, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.captcha-subtitle {
    font-size: 14px;
    color: #aaa;
    margin: 0;
    line-height: 1.5;
    max-width: 300px;
}

.captcha-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 10px 0 4px;
}

.captcha-note {
    font-size: 12px;
    color: #4b5563;
    margin: 0;
}

/* label optional tag */
.label-optional {
    color: #4b5563;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    margin-left: 4px;
}


/* ==============================
   20. REGISTER-SPECIFIC LINK IN AUTH-SWITCH
   (for index.html .auth-switch link)
============================== */

.auth-register-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.auth-register-link:hover {
    color: white;
}

.auth-register-link strong {
    color: #0ea5e9;
}


/* ==============================
   20. RESPONSIVE
============================== */

@media (max-width: 600px) {
    .app-header {
        padding: 12px 16px;
    }

    .page-wrap {
        padding: 24px 12px 48px;
    }

    .card-header,
    .card-body {
        padding-left: 22px;
        padding-right: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: 1;
    }

    .form-divider {
        grid-column: 1;
    }
}

/* ==============================
   21. LIGHT MODE OVERRIDES
============================== */

html[data-theme="light"],
html[data-theme="light"] body {
    background: #f6f5ff;
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at top left, rgba(139,92,246,0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(236,72,153,0.12), transparent 32%),
        linear-gradient(160deg, #f8fafc 0%, #fdf2f8 44%, #eef2ff 100%);
    color: #0f172a;
}

html[data-theme="light"] .app-header {
    background: rgba(255,255,255,0.72);
    border-bottom: 1px solid rgba(148,163,184,0.18);
    backdrop-filter: blur(14px);
}

html[data-theme="light"] .brand-block,
html[data-theme="light"] .brand-block:visited,
html[data-theme="light"] .brand-block:hover,
html[data-theme="light"] .brand-block:active {
    color: #0f172a;
}

html[data-theme="light"] .brand-tagline {
    color: #64748b;
    opacity: 1;
}

html[data-theme="light"] .header-link {
    color: #475569;
}

html[data-theme="light"] .header-link:hover {
    color: #0f172a;
}

html[data-theme="light"] .header-link strong {
    color: #7c3aed;
}

html[data-theme="light"] .register-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 28px 70px rgba(76,29,149,0.14);
}

html[data-theme="light"] .card-header {
    border-bottom-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .card-header::before {
    background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(236,72,153,0.05));
}

html[data-theme="light"] .card-header-eyebrow,
html[data-theme="light"] .form-group > label:first-child,
html[data-theme="light"] .form-divider span {
    color: #64748b;
}

html[data-theme="light"] .card-header h2,
html[data-theme="light"] .success-screen p strong {
    color: #0f172a;
}

html[data-theme="light"] .card-header p,
html[data-theme="light"] .strength-label,
html[data-theme="light"] .field-hint,
html[data-theme="light"] .terms-row span,
html[data-theme="light"] .signin-row,
html[data-theme="light"] .captcha-subtitle,
html[data-theme="light"] .success-screen p {
    color: #64748b;
    opacity: 1;
}

html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] select {
    background: #ffffff;
    border-color: rgba(148,163,184,0.32);
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
}

html[data-theme="light"] input::placeholder {
    color: #94a3b8;
}

html[data-theme="light"] input:hover,
html[data-theme="light"] select:hover {
    border-color: rgba(139,92,246,0.34);
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus {
    border-color: rgba(139,92,246,0.55);
    box-shadow:
        0 0 0 4px rgba(139,92,246,0.12),
        inset 0 1px 2px rgba(15,23,42,0.04);
}

html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
}

html[data-theme="light"] select option {
    background: #ffffff;
    color: #0f172a;
}

html[data-theme="light"] .toggle-pw {
    color: #94a3b8;
}

html[data-theme="light"] .toggle-pw:hover {
    color: #475569;
}

html[data-theme="light"] .strength-bar span {
    background: rgba(148,163,184,0.24);
}

html[data-theme="light"] .gender-pills label {
    border-color: rgba(148,163,184,0.22);
    background: rgba(255,255,255,0.72);
    color: #64748b;
}

html[data-theme="light"] .gender-pills label:hover {
    background: rgba(139,92,246,0.08);
    border-color: rgba(139,92,246,0.28);
}

html[data-theme="light"] .gender-pills input[type="radio"]:checked + label {
    border-color: rgba(139,92,246,0.52);
    background: rgba(139,92,246,0.12);
    color: #7c3aed;
}

html[data-theme="light"] .form-divider::before,
html[data-theme="light"] .form-divider::after {
    background: rgba(148,163,184,0.22);
}

html[data-theme="light"] .age-notice,
html[data-theme="light"] .form-alert {
    background: rgba(244,63,94,0.06);
    border-color: rgba(244,63,94,0.18);
}

html[data-theme="light"] .age-notice,
html[data-theme="light"] .field-error,
html[data-theme="light"] .form-alert {
    color: #be123c;
}

html[data-theme="light"] .terms-row a,
html[data-theme="light"] .signin-row a,
html[data-theme="light"] .success-screen a,
html[data-theme="light"] .auth-register-link strong {
    color: #7c3aed;
}

html[data-theme="light"] .submit-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 14px 32px rgba(139,92,246,0.22);
}

html[data-theme="light"] .submit-btn:hover {
    box-shadow: 0 18px 36px rgba(139,92,246,0.26);
}

html[data-theme="light"] .site-footer {
    background: rgba(255,255,255,0.56);
    border-top-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .site-footer a,
html[data-theme="light"] .auth-register-link {
    color: #64748b;
}

html[data-theme="light"] .site-footer a:hover,
html[data-theme="light"] .auth-register-link:hover {
    color: #0f172a;
}

html[data-theme="light"] .site-footer .sep,
html[data-theme="light"] .captcha-note,
html[data-theme="light"] .label-optional {
    color: #94a3b8;
}

html[data-theme="light"] .back-btn {
    color: #64748b;
}

html[data-theme="light"] .back-btn:hover {
    color: #0f172a;
}
