
:root {
    --primary: #6338F5;
    --primary-dark: #4D27D7;
    --cyan: #19BFE9;
    --text: #201B3B;
    --muted: #89859F;
    --border: #E8E5F2;
    --danger: #C33246;
    --success: #159768;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", Arial, sans-serif;
    color: var(--text);
    background: #F7F6FF;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

.auth-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 16px 20px;
    overflow: hidden;
}

.auth-glow {
    position: fixed;
    z-index: -1;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(85px);
    opacity: .4;
    pointer-events: none;
}

.glow-one { top: -150px; left: -110px; background: #C8BAFF; }
.glow-two { right: -120px; bottom: -130px; background: #A8EEFF; }

.auth-card {
    width: 100%;
    max-width: 455px;
    padding: 32px 36px 27px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 25px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 24px 75px rgba(54,36,117,.10);
}

.signup-card { max-width: 485px; padding-top: 27px; }

.auth-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 auto 24px;
    text-decoration: none;
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.8px;
}

.auth-logo { width: 100px;  object-fit: contain; }

.auth-heading { text-align: center; margin-bottom: 24px; }

.auth-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 15px;
    border: 1px solid #E6DEFF;
    border-radius: 17px;
    background: linear-gradient(140deg,#F1EDFF,#E8FAFF);
    color: var(--primary);
    font-size: 22px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

.auth-heading h1 {
    margin: 0;
    font-size: clamp(23px,4vw,28px);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -1px;
}

.subtitle { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.auth-form { display: flex; flex-direction: column; gap: 17px; }
.form-group { min-width: 0; }

.form-group > label,
.label-row label {
    display: block;
    margin-bottom: 8px;
    color: #393451;
    font-size: 12px;
    font-weight: 700;
}

.label-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.text-link { margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 700; text-decoration: none; }

.text-link:hover, .switch a:hover, .legal-links a:hover, .terms-row a:hover {
    text-decoration: underline;
}

.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }

.field-icon {
    position: absolute;
    left: 15px;
    z-index: 1;
    color: #9A94B2;
    font-size: 15px;
    pointer-events: none;
    transition: color .2s;
}

.input-wrap input {
    width: 100%;
    min-width: 0;
    height: 49px;
    padding: 0 15px 0 43px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #FCFBFF;
    color: var(--text);
    font-size: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input::placeholder { color: #B1ADC1; }
.input-wrap input:hover { border-color: #D2C9F6; }

.input-wrap:focus-within input {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99,56,245,.09);
}

.input-wrap:focus-within .field-icon { color: var(--primary); }

.input-wrap input[data-has-toggle="true"] { padding-right: 82px; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 4px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #817A9B;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.password-toggle:hover { color: var(--primary); }
.password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.field-hint { margin: 7px 0 0; color: #9691AA; font-size: 10px; line-height: 1.5; }

/* Custom validation — replaces native format popups */
.field-error[hidden] { display: none !important; }

.field-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 0;
    padding: 10px 11px;
    border: 1px solid #F5CFD5;
    border-radius: 10px;
    background: linear-gradient(120deg,#FFF4F5,#FFF9FA);
    color: var(--danger);
    font-size: 11px;
    line-height: 1.55;
    animation: validationIn .2s ease-out;
}

.field-error > i { flex-shrink: 0; margin-top: 2px; }

.input-wrap input.is-invalid {
    border-color: #E5485D;
    background: #FFF9FA;
}

.input-wrap input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(229,72,93,.10);
}

.input-wrap input.is-valid { border-color: var(--success); }

@keyframes validationIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Password strength meter */
.password-strength { margin-top: 10px; }

.strength-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: #817B98;
    font-size: 10px;
}

.strength-heading strong { font-weight: 700; }

.strength-track {
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: #ECEAF3;
}

.strength-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width .25s ease, background .25s ease;
}

.strength-fill.weak { background: #E5484D; }
.strength-fill.fair { background: #E9A23B; }
.strength-fill.good { background: var(--cyan); }
.strength-fill.strong { background: var(--success); }

.password-tips {
    display: grid;
    gap: 5px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    color: #8A849F;
    font-size: 10px;
}

.password-tips li { display: flex; align-items: center; gap: 7px; }
.password-tips li i { width: 12px; color: #B2ADC2; }
.password-tips li.passed { color: #147A54; }
.password-tips li.passed i { color: var(--success); }

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #77718E;
    font-size: 11px;
    line-height: 1.7;
    cursor: pointer;
}

.terms-row input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--primary);
}

.terms-row a { color: var(--primary); font-weight: 700; text-decoration: none; }

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 14px 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(110deg,var(--primary),#7955FF);
    box-shadow: 0 9px 20px rgba(99,56,245,.21);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.auth-button:hover { transform: translateY(-2px); box-shadow: 0 13px 25px rgba(99,56,245,.27); }
.auth-button:focus-visible { outline: 3px solid rgba(25,191,233,.65); outline-offset: 3px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 23px 0 17px;
    color: #A7A2B8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #EEEAF6; }

.switch { margin: 0; text-align: center; color: #817C96; font-size: 12px; line-height: 1.8; }
.switch a { margin-left: 3px; color: var(--primary); font-weight: 700; text-decoration: none; }

.legal-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 22px 0 12px; color: #9691A9; font-size: 10px; }
.legal-note i { color: #16A7C9; font-size: 12px; }

.legal-links { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0; color: #A8A3B9; font-size: 10px; }
.legal-links a { color: #8E88A6; font-weight: 500; text-decoration: none; }

.page-caption { margin: 18px 0 0; color: #9791B2; font-size: 9px; font-weight: 800; letter-spacing: 2px; text-align: center; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 19px;
    padding: 13px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.6;
    animation: validationIn .2s ease-out;
}

.alert > i { flex-shrink: 0; margin-top: 2px; font-size: 15px; }
.alert-error { color: #B42335; background: #FFF4F5; border-color: #F7D3D8; }
.alert-success { color: #147A54; background: #F0FBF6; border-color: #B7E9D0; }

@media (max-width: 520px) {
    .auth-page { justify-content: flex-start; padding: 20px 12px; }
    .auth-card, .signup-card { max-width: 100%; padding: 25px 20px 22px; border-radius: 20px; }
    .auth-brand { margin-bottom: 21px; font-size: 20px; }
    .auth-logo { width: 38px; height: 38px; }
    .auth-heading { margin-bottom: 21px; }
    .auth-form { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
