html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: #02060d;
}


/* =========================================
   Authentication page
   ========================================= */

.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 40px 20px;
    color: #eef7ff;
    background: linear-gradient( 180deg, rgba(1, 5, 10, 0.18) 0%, rgba(1, 5, 10, 0.28) 45%, rgba(1, 5, 10, 0.48) 100% ), url("/images/auth/oryndrax-auth.png") center center / cover no-repeat;
    background-color: #02060d;
}


/* =========================================
   Main shell
   ========================================= */

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
}


/* =========================================
   Brand
   ========================================= */

.auth-brand {
    margin-bottom: 28px;
    text-align: center;
}

.auth-logo {
    display: inline-block;
    color: #ffffff;
    font-size: clamp(32px, 7vw, 46px);
    font-weight: 800;
    letter-spacing: 0.22em;
    line-height: 1;
    text-decoration: none;
    text-shadow: 0 0 15px rgba(82, 207, 255, 0.28), 0 3px 18px rgba(0, 0, 0, 0.65);
}

    .auth-logo:hover {
        color: #ffffff;
    }

.auth-tagline {
    margin-top: 8px;
    color: #8aa9ba;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}


/* =========================================
   Login / register panel
   ========================================= */

.auth-panel {
    padding: 34px;
    border: 1px solid rgba(118, 183, 218, 0.19);
    border-radius: 18px;
    background: linear-gradient( 145deg, rgba(12, 25, 38, 0.91), rgba(5, 13, 22, 0.93) );
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


/* =========================================
   Panel header
   ========================================= */

.auth-panel-header {
    margin-bottom: 28px;
}

.auth-kicker {
    margin-bottom: 10px;
    color: #4fc8ee;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
}

.auth-panel h1 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 28px;
    font-weight: 650;
    line-height: 1.2;
}

.auth-panel p {
    margin: 0;
    color: #819aaa;
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================
   Form
   ========================================= */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.auth-field label {
    color: #bdd0dc;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.auth-field input,
.auth-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid rgba(128, 181, 210, 0.18);
    border-radius: 8px;
    outline: none;
    color: #edf8ff;
    background: rgba(2, 9, 16, 0.76);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

    .auth-field input::placeholder {
        color: #4f6675;
    }

    .auth-field input:hover {
        border-color: rgba(128, 181, 210, 0.3);
    }

    .auth-field input:focus,
    .auth-field select:focus {
        border-color: rgba(64, 193, 235, 0.72);
        background: rgba(4, 14, 24, 0.94);
        box-shadow: 0 0 0 3px rgba(37, 169, 217, 0.1);
    }

.auth-field select {
    min-height: 46px;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, #6fa8c2 50%),
        linear-gradient(135deg, #6fa8c2 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}


    /* =========================================
   Browser autofill
   ========================================= */

    .auth-field input:-webkit-autofill,
    .auth-field input:-webkit-autofill:hover,
    .auth-field input:-webkit-autofill:focus {
        -webkit-text-fill-color: #edf8ff;
        -webkit-box-shadow: 0 0 0 1000px #07131e inset;
        caret-color: #edf8ff;
        transition: background-color 9999s ease-in-out 0s;
    }


/* =========================================
   Links
   ========================================= */

.auth-link {
    color: #55c9ef;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.15s ease;
}

    .auth-link:hover {
        color: #8ce1ff;
    }


/* =========================================
   Password field
   ========================================= */

.auth-password-wrap {
    position: relative;
}

    .auth-password-wrap input {
        padding-right: 72px;
    }

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 32px;
    border: 0;
    border-radius: 4px;
    padding: 0 7px;
    color: #55c9ef;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
}

    .auth-password-toggle:hover {
        color: #91e3ff;
    }

    .auth-password-toggle:focus-visible {
        outline: 2px solid rgba(85, 201, 239, 0.65);
        outline-offset: 2px;
    }


/* =========================================
   Password rules
   ========================================= */

.auth-password-rules {
    margin-top: 2px;
    color: #607b8c;
    font-size: 11px;
    line-height: 1.5;
}


/* =========================================
   Remember me
   ========================================= */

.auth-remember {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 9px;
    color: #8299a8;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

    .auth-remember input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: #26aedd;
        cursor: pointer;
    }


/* =========================================
   Submit button
   ========================================= */

.auth-submit {
    min-height: 48px;
    border: 1px solid #48c5ee;
    border-radius: 8px;
    color: #031018;
    background: linear-gradient( 180deg, #72dcfa, #2daed6 );
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(36, 167, 212, 0.14);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

    .auth-submit:hover:not(:disabled) {
        filter: brightness(1.08);
        transform: translateY(-1px);
        box-shadow: 0 10px 28px rgba(36, 167, 212, 0.22);
    }

    .auth-submit:active:not(:disabled) {
        transform: translateY(0);
    }

    .auth-submit:focus-visible {
        outline: 2px solid #91e3ff;
        outline-offset: 3px;
    }

    .auth-submit:disabled {
        cursor: wait;
        opacity: 0.7;
        transform: none;
    }

    .auth-submit.is-loading {
        filter: saturate(0.8);
    }


/* =========================================
   Divider
   ========================================= */

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 27px 0 18px;
    color: #526b7b;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.17em;
}

    .auth-divider span {
        height: 1px;
        background: rgba(119, 169, 196, 0.16);
    }

    .auth-divider b {
        font: inherit;
        font-weight: 600;
    }


/* =========================================
   Create account
   ========================================= */

.auth-create {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(87, 176, 211, 0.25);
    border-radius: 8px;
    color: #a9c6d6;
    background: rgba(7, 20, 31, 0.68);
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.05em;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

    .auth-create:hover {
        color: #ffffff;
        border-color: rgba(85, 202, 239, 0.5);
        background: rgba(15, 37, 53, 0.86);
        transform: translateY(-1px);
    }

    .auth-create:active {
        transform: translateY(0);
    }

    .auth-create:focus-visible {
        outline: 2px solid rgba(85, 201, 239, 0.65);
        outline-offset: 3px;
    }


/* =========================================
   Secondary action
   ========================================= */

[data-resend-wrapper] {
    margin-top: 14px;
}

.auth-secondary-action {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(87, 176, 211, 0.22);
    border-radius: 8px;
    color: #8fdcf5;
    background: rgba(7, 20, 31, 0.56);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
}

    .auth-secondary-action:hover:not(:disabled) {
        color: #ffffff;
        border-color: rgba(85, 202, 239, 0.45);
        background: rgba(15, 37, 53, 0.78);
    }

    .auth-secondary-action:disabled {
        cursor: wait;
        opacity: 0.65;
    }


/* =========================================
   Validation
   ========================================= */

.auth-validation {
    color: #ff8791;
    font-size: 11px;
    line-height: 1.4;
}

.input-validation-error {
    border-color: rgba(255, 112, 125, 0.65) !important;
    box-shadow: 0 0 0 3px rgba(255, 112, 125, 0.08);
}


/* =========================================
   Success message
   ========================================= */

.auth-success {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(79, 200, 238, 0.28);
    border-radius: 8px;
    color: #bdefff;
    background: rgba(25, 122, 155, 0.14);
    font-size: 12px;
    line-height: 1.5;
}


/* =========================================
   Error message
   ========================================= */

.auth-error {
    color: #ffd2d6 !important;
    border-color: rgba(255, 112, 125, 0.34) !important;
    background: rgba(132, 33, 45, 0.18) !important;
}


/* =========================================
   Footer
   ========================================= */

.auth-footer {
    margin-top: 22px;
    text-align: center;
    color: #546d7c;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}


/* =========================================
   Tablet / smaller screens
   ========================================= */

@media (max-width: 768px) {

    .auth-page {
        background-position: center center;
    }
}


/* =========================================
   Mobile
   ========================================= */

@media (max-width: 576px) {

    .auth-page {
        align-items: flex-start;
        min-height: 100svh;
        padding: max(28px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
        background: linear-gradient( 180deg, rgba(1, 5, 10, 0.30) 0%, rgba(1, 5, 10, 0.48) 45%, rgba(1, 5, 10, 0.72) 100% ), url("/images/auth/oryndrax-auth.png") center center / cover no-repeat;
    }

    .auth-brand {
        margin-bottom: 22px;
    }

    .auth-logo {
        font-size: clamp(29px, 10vw, 38px);
        letter-spacing: 0.18em;
    }

    .auth-tagline {
        font-size: 10px;
        letter-spacing: 0.25em;
    }

    .auth-panel {
        padding: 26px 20px;
        border-radius: 14px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

        .auth-panel h1 {
            font-size: 25px;
        }

    .auth-field input,
    .auth-field select {
        min-height: 48px;
        font-size: 16px;
    }

    .auth-submit {
        min-height: 50px;
    }

    .auth-create {
        min-height: 48px;
    }
}


/* =========================================
   Very small phones
   ========================================= */

@media (max-width: 360px) {

    .auth-page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .auth-panel {
        padding: 22px 16px;
    }

    .auth-logo {
        font-size: 27px;
        letter-spacing: 0.14em;
    }

    .auth-field-header {
        gap: 10px;
    }
}


/* =========================================
   Reduced motion
   ========================================= */

@media (prefers-reduced-motion: reduce) {

    .auth-submit,
    .auth-create,
    .auth-secondary-action,
    .auth-field input,
    .auth-field select {
        transition: none;
    }
}


/* =========================================
   Registration complete
   ========================================= */

.auth-success strong {
    display: block;
    color: #e8f9ff;
    font-weight: 700;
}

.auth-success p {
    color: #9cc4d6;
}

.auth-panel > .auth-submit {
    width: 100%;
    margin-top: 20px;
}

.api-message:not([hidden]) {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(118, 183, 218, 0.18);
    border-radius: 8px;
    background: rgba(4, 15, 24, 0.72);
}

/* Registration: compact two-column desktop layout */
.auth-form-register .auth-register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
}

.auth-form-register .auth-field {
    min-width: 0;
}

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: #9fb7c6;
    font-size: 12px;
    line-height: 1.55;
    cursor: pointer;
}

.auth-terms input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: #39bfe9;
}

.auth-terms a {
    color: #59c9ef;
    text-decoration: none;
}

.auth-terms a:hover {
    text-decoration: underline;
}

@media (min-width: 769px) {
    .auth-form-register {
        gap: 18px;
    }

    .auth-shell-register {
        max-width: 760px;
    }

    .auth-shell-register .auth-brand {
        margin-bottom: 18px;
    }

    .auth-shell-register .auth-panel {
        padding: 28px 34px;
    }

    .auth-shell-register .auth-panel-header {
        margin-bottom: 22px;
    }
}

@media (max-width: 768px) {
    .auth-form-register .auth-register-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Author styles must preserve registration visibility from the API status. */
[data-registration-content][hidden],
.auth-form-register [data-invite][hidden] {
    display: none !important;
}