/* ================================================================
   AUTH FOUNDATION
================================================================ */

.auth-body {
    margin: 0;
    min-height: 100vh;

    color: var(--text-primary);
    background: var(--app-background);

    transition:
        color var(--transition-base),
        background var(--transition-base);
}


/* ================================================================
   AUTH LAYOUT
================================================================ */

.auth-layout {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        minmax(380px, 42%)
        minmax(0, 1fr);
}


/* ================================================================
   BRAND PANEL
================================================================ */

.auth-brand-panel {
    position: relative;

    min-height: 100vh;

    padding: 42px 48px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-right:
        1px solid var(--border);

    color: var(--text-primary);

    background:
        radial-gradient(
            circle at 75% 20%,
            color-mix(
                in srgb,
                var(--primary) 18%,
                transparent
            ),
            transparent 32%
        ),
        linear-gradient(
            145deg,
            var(--surface) 0%,
            var(--app-background) 55%,
            var(--surface-soft) 100%
        );

    transition:
        color var(--transition-base),
        background var(--transition-base),
        border-color var(--transition-base);
}


.auth-brand-panel::after {
    content: "";

    position: absolute;

    width: 420px;
    height: 420px;

    right: -220px;
    bottom: -180px;

    border-radius: 50%;

    background:
        color-mix(
            in srgb,
            var(--primary) 14%,
            transparent
        );

    filter: blur(80px);

    pointer-events: none;
}


/* ================================================================
   BRAND
================================================================ */

.auth-brand-top {
    position: relative;
    z-index: 2;
}


.auth-brand {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    color: var(--text-primary);

    font-size: 18px;
    font-weight: 800;

    letter-spacing: -0.5px;

    text-decoration: none;

    transition:
        color var(--transition-fast),
        opacity var(--transition-fast);
}


.auth-brand:hover {
    color: var(--text-primary);
    opacity: 0.92;
}


.auth-brand span {
    color: var(--primary-strong);
}


/* ================================================================
   BRAND CONTENT
================================================================ */

.auth-brand-content {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 520px;

    margin: auto 0;
}


.auth-brand-eyebrow {
    display: inline-block;

    margin-bottom: 18px;

    color: var(--primary-strong);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.1em;

    text-transform: uppercase;
}


.auth-brand-content h1 {
    margin: 0;

    color: var(--text-primary);

    font-size:
        clamp(
            42px,
            4.5vw,
            62px
        );

    font-weight: 720;

    line-height: 1;

    letter-spacing: -3px;
}


.auth-brand-content h1 span {
    display: block;

    color: var(--primary-strong);
}


.auth-brand-content > p {
    max-width: 450px;

    margin: 24px 0 0;

    color: var(--text-secondary);

    font-size: 14px;

    line-height: 1.7;
}


/* ================================================================
   BRAND FEATURES
================================================================ */

.auth-brand-features {
    margin-top: 36px;

    display: flex;
    flex-direction: column;

    gap: 14px;
}


.auth-brand-feature {
    display: flex;

    align-items: center;

    gap: 11px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 550;
}


.auth-brand-feature span {
    width: 23px;
    height: 23px;

    flex: 0 0 23px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid
        color-mix(
            in srgb,
            var(--primary) 28%,
            var(--border)
        );

    border-radius: 7px;

    color: var(--primary-strong);

    background: var(--primary-soft);

    font-size: 10px;
    font-weight: 800;
}


/* ================================================================
   BRAND FOOTER
================================================================ */

.auth-brand-footer {
    position: relative;
    z-index: 2;

    padding-top: 18px;

    display: flex;

    justify-content: space-between;

    gap: 20px;

    border-top:
        1px solid var(--border);

    color: var(--text-muted);

    font-size: 10px;
}


.auth-brand-footer strong {
    color: var(--primary-strong);
}


/* ================================================================
   FORM PANEL
================================================================ */

.auth-form-panel {
    min-width: 0;
    min-height: 100vh;

    padding: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at 50% 15%,
            color-mix(
                in srgb,
                var(--primary) 8%,
                transparent
            ),
            transparent 30%
        ),
        var(--app-background);

    transition:
        background var(--transition-base);
}


.auth-form-container {
    width: 100%;
    max-width: 440px;
}


/* ================================================================
   AUTH CARD
================================================================ */

.auth-card {
    width: 100%;

    padding: 38px;

    border:
        1px solid var(--border);

    border-radius: 20px;

    color: var(--text-primary);

    background: var(--surface);

    box-shadow: var(--shadow-lg);

    transition:
        color var(--transition-base),
        background var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
}


/* ================================================================
   CARD HEADER
================================================================ */

.auth-card-header,
.auth-form-header {
    margin-bottom: 30px;
}


.auth-eyebrow {
    display: inline-block;

    margin-bottom: 10px;

    color: var(--primary-strong);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.auth-card-header h1,
.auth-form-title {
    margin: 0;

    color: var(--text-primary);

    font-size: 30px;
    font-weight: 720;

    line-height: 1.15;

    letter-spacing: -1.3px;
}


.auth-card-header p,
.auth-form-description {
    max-width: 420px;

    margin: 10px 0 0;

    color: var(--text-secondary);

    font-size: 13px;

    line-height: 1.6;
}


/* ================================================================
   FORM
================================================================ */

.auth-form {
    width: 100%;
}


.auth-fields {
    display: flex;
    flex-direction: column;

    gap: 20px;
}


.auth-form-group,
.auth-field {
    width: 100%;
}


.auth-form-group {
    margin-bottom: 20px;
}


/* ================================================================
   LABELS
================================================================ */

.auth-label,
.auth-field-label {
    display: block;

    color: var(--text-primary);

    font-size: 12px;
    font-weight: 650;
}


.auth-label {
    margin-bottom: 8px;
}


.auth-label-row,
.auth-field-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 8px;
}


.auth-label-row .auth-label {
    margin: 0;
}


.auth-field-required {
    flex-shrink: 0;

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.06em;

    text-transform: uppercase;
}


/* ================================================================
   STANDARD INPUT WRAPPERS
================================================================ */

.auth-input-wrap,
.auth-field-control {
    width: 100%;
}


/* ================================================================
   INPUTS
================================================================ */

.auth-input-wrap input,
.auth-input-wrap select,
.auth-input-wrap textarea,
.auth-field-control input,
.auth-field-control select,
.auth-field-control textarea {
    width: 100%;
    min-height: 50px;

    padding: 0 14px;

    border:
        1px solid var(--border);

    border-radius: 11px;

    outline: none;

    color: var(--text-primary);

    background: var(--surface-soft);

    font: inherit;

    font-size: 13px;
    font-weight: 500;

    transition:
        color var(--transition-base),
        border-color var(--transition-base),
        background var(--transition-base),
        box-shadow var(--transition-base);
}


.auth-input-wrap textarea,
.auth-field-control textarea {
    min-height: 110px;

    padding-top: 13px;
    padding-bottom: 13px;

    resize: vertical;
}


.auth-input-wrap input::placeholder,
.auth-input-wrap textarea::placeholder,
.auth-field-control input::placeholder,
.auth-field-control textarea::placeholder {
    color: var(--text-muted);
}


.auth-input-wrap input:hover,
.auth-input-wrap select:hover,
.auth-input-wrap textarea:hover,
.auth-field-control input:hover,
.auth-field-control select:hover,
.auth-field-control textarea:hover {
    border-color: var(--border-strong);
}


.auth-input-wrap input:focus,
.auth-input-wrap select:focus,
.auth-input-wrap textarea:focus,
.auth-field-control input:focus,
.auth-field-control select:focus,
.auth-field-control textarea:focus {
    border-color: var(--border-focus);

    background: var(--surface);

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--primary) 14%,
            transparent
        );
}


/* ================================================================
   SELECT
================================================================ */

.auth-input-wrap select,
.auth-field-control select {
    appearance: none;

    padding-right: 42px;

    cursor: pointer;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            var(--text-muted) 50%
        ),
        linear-gradient(
            135deg,
            var(--text-muted) 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 18px) 22px,
        calc(100% - 13px) 22px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}


/* ================================================================
   FIELD HELP
================================================================ */

.auth-field-help,
.auth-field-hint {
    display: block;

    margin-top: 7px;

    color: var(--text-muted);

    font-size: 10px;

    line-height: 1.55;
}


.auth-field-help ul {
    margin: 6px 0 0;

    padding-left: 18px;
}


/* ================================================================
   FIELD ERRORS
================================================================ */

.auth-card .field-error,
.auth-field-errors {
    margin-top: 6px;

    color: var(--danger-text);

    font-size: 11px;

    line-height: 1.5;
}


.auth-card .field-error {
    display: block;
}


.auth-field-errors {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


.auth-field-error
.auth-field-control input,

.auth-field-error
.auth-field-control select,

.auth-field-error
.auth-field-control textarea {
    border-color: var(--danger-border);

    background: var(--danger-soft);
}


.auth-field-error
.auth-field-control input:focus,

.auth-field-error
.auth-field-control select:focus,

.auth-field-error
.auth-field-control textarea:focus {
    border-color: var(--danger-text);

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--danger-text) 12%,
            transparent
        );
}


/* ================================================================
   FORM ALERTS
================================================================ */

.auth-alert,
.auth-form-alert {
    margin-bottom: 22px;

    padding: 12px 14px;

    border-radius: 10px;

    font-size: 12px;
}


.auth-alert-error,
.auth-form-alert {
    border:
        1px solid var(--danger-border);

    color: var(--danger-text);

    background: var(--danger-soft);
}


.auth-form-alert p {
    margin: 0;

    font-size: 12px;
    font-weight: 500;

    line-height: 1.55;
}


.auth-form-alert p + p {
    margin-top: 5px;
}


/* ================================================================
   FORGOT PASSWORD
================================================================ */

.auth-forgot-link {
    color: var(--primary);

    font-size: 11px;
    font-weight: 650;

    text-decoration: none;
}


.auth-forgot-link:hover {
    color: var(--primary-hover);
}


/* ================================================================
   PRIMARY BUTTON
================================================================ */

.auth-submit-button {
    position: relative;

    width: 100%;
    min-height: 50px;

    margin-top: 5px;
    padding: 0 20px;

    border: 0;

    border-radius: 11px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    color:
        var(--text-inverse);

    background:
        linear-gradient(
            120deg,
            var(--primary),
            var(--primary-active)
        );

    box-shadow:
        0 10px 26px
        color-mix(
            in srgb,
            var(--primary) 24%,
            transparent
        );

    font: inherit;

    font-size: 13px;
    font-weight: 750;

    line-height: 1;

    cursor: pointer;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast);
}


.auth-submit-button:hover {
    color:
        var(--text-inverse);

    transform:
        translateY(-1px);

    box-shadow:
        0 14px 32px
        color-mix(
            in srgb,
            var(--primary) 30%,
            transparent
        );
}


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


.auth-submit-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--primary) 24%,
            transparent
        ),
        0 10px 26px
        color-mix(
            in srgb,
            var(--primary) 24%,
            transparent
        );
}


.auth-submit-button:disabled {
    cursor: wait;

    opacity: 0.8;

    transform: none;
}


/* ================================================================
   PROFILE SUBMIT SPACING
================================================================ */

.profile-completion
.auth-submit-button {
    margin-top: 28px;
}


/* ================================================================
   LOADING
================================================================ */

.auth-submit-button
.button-spinner {
    width: 17px;
    height: 17px;

    display: none;

    flex: 0 0 17px;

    border:
        2px solid
        color-mix(
            in srgb,
            currentColor 30%,
            transparent
        );

    border-top-color:
        currentColor;

    border-radius: 50%;

    animation:
        auth-spin
        0.7s
        linear
        infinite;
}


.auth-submit-button.is-loading
.button-spinner {
    display: inline-block;
}


.auth-submit-button.is-loading {
    pointer-events: none;
}


@keyframes auth-spin {

    to {
        transform: rotate(360deg);
    }

}


/* ================================================================
   REGISTER LINK
================================================================ */

.auth-register {
    margin-top: 24px;

    padding-top: 22px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 5px;

    border-top:
        1px solid var(--border);

    color: var(--text-secondary);

    font-size: 12px;
}


.auth-register a {
    color: var(--primary);

    font-weight: 700;

    text-decoration: none;
}


.auth-register a:hover {
    color: var(--primary-hover);
}


/* ================================================================
   OTP
================================================================ */

.otp-input {
    text-align: center;

    font-size: 24px;
    font-weight: 700;

    letter-spacing: 8px;
}


/* ================================================================
   PASSWORD FIELD
================================================================ */

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


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


.auth-password-toggle {
    position: absolute;

    top: 50%;
    right: 8px;

    min-width: 50px;
    height: 34px;

    padding: 0 8px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 8px;

    color: var(--text-secondary);

    background: transparent;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}


.auth-password-toggle:hover {
    color: var(--primary-strong);

    background: var(--primary-soft);
}


.auth-password-toggle:focus-visible {
    outline: none;

    color: var(--primary-strong);

    box-shadow:
        0 0 0 2px
        color-mix(
            in srgb,
            var(--primary) 20%,
            transparent
        );
}


/* ================================================================
   AUTOFILL
================================================================ */

.auth-input-wrap input:-webkit-autofill,
.auth-input-wrap input:-webkit-autofill:hover,
.auth-input-wrap input:-webkit-autofill:focus,
.auth-field-control input:-webkit-autofill,
.auth-field-control input:-webkit-autofill:hover,
.auth-field-control input:-webkit-autofill:focus {
    -webkit-text-fill-color:
        var(--text-primary);

    box-shadow:
        0 0 0 1000px
        var(--surface-soft)
        inset;

    transition:
        background-color
        9999s
        ease-in-out
        0s;
}


/* ================================================================
   MOBILE ELEMENTS
================================================================ */

.auth-mobile-brand,
.auth-mobile-footer {
    display: none;
}


/* ================================================================
   TABLET
================================================================ */

@media (max-width: 960px) {

    .auth-layout {
        grid-template-columns:
            38%
            62%;
    }


    .auth-brand-panel {
        padding: 34px;
    }


    .auth-brand-content h1 {
        font-size: 42px;

        letter-spacing: -2px;
    }


    .auth-form-panel {
        padding: 30px;
    }

}


/* ================================================================
   MOBILE
================================================================ */

@media (max-width: 760px) {

    .auth-layout {
        display: block;
    }


    .auth-brand-panel {
        display: none;
    }


    .auth-form-panel {
        min-height: 100vh;

        padding: 28px 18px;

        align-items: center;
    }


    .auth-form-container {
        max-width: 440px;
    }


    .auth-mobile-brand {
        margin-bottom: 24px;

        display: flex;

        justify-content: center;
    }


    .auth-card {
        padding: 30px 26px;
    }


    .auth-mobile-footer {
        margin-top: 22px;

        display: flex;

        justify-content: space-between;

        gap: 15px;

        color: var(--text-muted);

        font-size: 10px;
    }


    .auth-mobile-footer strong {
        color: var(--primary-strong);
    }

}


/* ================================================================
   PROFILE MOBILE
================================================================ */

@media (max-width: 600px) {

    .auth-form-header {
        margin-bottom: 26px;
    }


    .auth-card-header h1,
    .auth-form-title {
        font-size: 27px;
    }


    .auth-fields {
        gap: 18px;
    }


    .auth-input-wrap input,
    .auth-input-wrap select,
    .auth-input-wrap textarea,
    .auth-field-control input,
    .auth-field-control select,
    .auth-field-control textarea {
        /*
         * Prevent automatic input zoom on iOS Safari.
         */
        font-size: 16px;
    }


    .profile-completion
    .auth-submit-button {
        margin-top: 24px;
    }

}


/* ================================================================
   SMALL MOBILE
================================================================ */

@media (max-width: 480px) {

    .auth-form-panel {
        padding: 22px 14px;
    }


    .auth-card {
        padding: 28px 20px;

        border-radius: 17px;
    }


    .auth-card-header h1,
    .auth-form-title {
        font-size: 27px;
    }


    .auth-mobile-footer {
        align-items: center;

        flex-direction: column;

        gap: 4px;
    }

}
