:root {
    --white: #ffffff;
    --background: #f8fafc;

    --black: #0b1220;
    --text: #111827;
    --text-soft: #334155;
    --muted: #64748b;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --blue: #3158a8;
    --blue-dark: #244582;
    --blue-hover: #294d96;

    --blue-light: #f3f6fb;

    --radius: 14px;
    --radius-small: 9px;

    --transition: 160ms ease;
}


/* ========================================
   RESET
======================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;

    margin: 0;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}


/* ========================================
   AUTH PAGE
======================================== */

.auth-page {
    position: relative;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding:
        48px 24px
        40px;
}


/* ========================================
   TOP BRAND DETAIL
======================================== */

.auth-page::before {
    content: "";

    position: absolute;

    top: 0;
    left: 50%;

    width: 36px;
    height: 2px;

    transform: translateX(-50%);

    background: var(--blue);
}


/* ========================================
   XERION LOGO
======================================== */

.auth-logo {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 38px;

    transition:
        opacity var(--transition);
}

.auth-logo:hover {
    opacity: 0.78;
}

.auth-logo img {
    width: 128px;
    height: auto;

    max-width: 70vw;
    max-height: 44px;

    object-fit: contain;
}


/* ========================================
   AUTH CONTAINER
======================================== */

.auth-container {
    width: 100%;
    max-width: 420px;

    margin: 0 auto;
}


/* ========================================
   AUTH VIEW
======================================== */

.auth-view {
    width: 100%;

    padding: 34px;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 8px 28px rgba(15, 23, 42, 0.045);
}

.auth-view.is-hidden {
    display: none;
}


/* ========================================
   AUTH HEADER
======================================== */

.auth-header {
    margin-bottom: 30px;
}

.auth-label {
    display: inline-flex;

    align-items: center;
    gap: 7px;

    color: var(--blue);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.16em;
    line-height: 1;

    text-transform: uppercase;
}

.auth-label::before {
    content: "";

    width: 14px;
    height: 1px;

    background: var(--blue);
}

.auth-header h1 {
    margin:
        13px 0
        9px;

    color: var(--black);

    font-size: 31px;
    font-weight: 700;

    line-height: 1.08;
    letter-spacing: -0.045em;
}

.auth-header p {
    margin: 0;

    max-width: 340px;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.55;
}


/* ========================================
   AUTH FORM
======================================== */

.auth-form {
    display: flex;
    flex-direction: column;

    gap: 19px;
}


/* ========================================
   FORM FIELD
======================================== */

.form-field {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.form-field label {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 600;

    line-height: 1.4;
}


/* ========================================
   FIELD HEADER
======================================== */

.field-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.field-header label {
    margin: 0;
}


/* ========================================
   INPUT
======================================== */

.form-field input {
    width: 100%;
    height: 46px;

    padding:
        0 13px;

    border:
        1px solid var(--border-strong);

    border-radius: var(--radius-small);

    outline: none;

    background: var(--white);
    color: var(--text);

    font-size: 14px;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-field input::placeholder {
    color: #94a3b8;
}

.form-field input:hover {
    border-color: #b7c3d3;
}

.form-field input:focus {
    border-color: var(--blue);

    box-shadow:
        0 0 0 3px
        rgba(49, 88, 168, 0.08);
}


/* ========================================
   FORGOT PASSWORD
======================================== */

.forgot-password {
    padding: 0;

    border: 0;

    background: transparent;

    color: var(--blue);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        color var(--transition);
}

.forgot-password:hover {
    color: var(--blue-dark);

    text-decoration: underline;
}


/* ========================================
   AUTH MESSAGE
======================================== */

.auth-message {
    min-height: 0;

    margin-top: -2px;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.5;
}

.auth-message:not(:empty) {
    padding:
        10px 12px;

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-small);

    background:
        var(--blue-light);
}


/* ========================================
   BUTTON SYSTEM
======================================== */

.button {
    min-height: 44px;

    padding:
        0 18px;

    border:
        1px solid transparent;

    border-radius:
        var(--radius-small);

    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-size: 14px;
    font-weight: 600;

    line-height: 1;

    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        box-shadow var(--transition),
        transform var(--transition);
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}


/* ========================================
   PRIMARY BUTTON
======================================== */

.button-primary {
    background: var(--blue);
    color: var(--white);

    box-shadow:
        0 2px 6px
        rgba(49, 88, 168, 0.12);
}

.button-primary:hover {
    background: var(--blue-hover);

    box-shadow:
        0 5px 14px
        rgba(49, 88, 168, 0.14);
}

.button-primary:active {
    transform: translateY(0);
}


/* ========================================
   AUTH SUBMIT
======================================== */

.auth-submit {
    width: 100%;

    min-height: 46px;

    margin-top: 1px;
}


/* ========================================
   AUTH SWITCH
======================================== */

.auth-switch {
    margin-top: 24px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 5px;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.5;

    text-align: center;
}

.auth-switch-button {
    padding: 0;

    border: 0;

    background: transparent;

    color: var(--blue);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        color var(--transition);
}

.auth-switch-button:hover {
    color: var(--blue-dark);

    text-decoration: underline;
}


/* ========================================
   BACK NAVIGATION
======================================== */

.auth-back {
    margin-top: 26px;

    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: #64748b;

    font-size: 13px;
    font-weight: 600;

    line-height: 1;

    transition:
        color var(--transition);
}

.auth-back:hover {
    color: var(--blue);
}


/* ========================================
   BACK ICON
======================================== */

.auth-back-icon {
    width: 28px;
    height: 28px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid var(--border);

    border-radius: 8px;

    background: var(--white);

    transition:
        border-color var(--transition),
        background var(--transition),
        transform var(--transition);
}

.auth-back-icon svg {
    width: 15px;
    height: 15px;
}

.auth-back:hover .auth-back-icon {
    border-color: #b8c5d7;

    background: var(--blue-light);

    transform: translateX(-2px);
}

.auth-back-brand {
    letter-spacing: 0.02em;
}


/* ========================================
   LEGAL LINKS (Phase 20 — every public page
   links to Terms/Privacy, not just the
   marketing footer)
======================================== */

.auth-legal-links {
    margin-top: 18px;

    display: flex;

    align-items: center;

    gap: 8px;

    color: #94a3b8;

    font-size: 12px;
}

.auth-legal-links a {
    color: #94a3b8;

    transition: color var(--transition);
}

.auth-legal-links a:hover {
    color: var(--blue);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 640px) {

    .auth-page {
        padding:
            40px 18px
            32px;
    }

    .auth-logo {
        margin-bottom: 32px;
    }

    .auth-logo img {
        width: 116px;

        max-height: 40px;
    }

    .auth-view {
        padding: 30px 26px;
    }

    .auth-header {
        margin-bottom: 27px;
    }

    .auth-header h1 {
        font-size: 29px;
    }
}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 380px) {

    .auth-page {
        padding:
            34px 14px
            28px;
    }

    .auth-logo {
        margin-bottom: 27px;
    }

    .auth-logo img {
        width: 108px;
    }

    .auth-view {
        padding:
            27px 21px;
    }

    .auth-header h1 {
        font-size: 27px;
    }

    .auth-form {
        gap: 18px;
    }

    .form-field input {
        height: 44px;
    }
}


/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}