/* Auth pages (login / registration / passwords) — loaded via app_stylesheet_link_tags */

/* -------------------------------------------------------------------------- */
/* Auth (login / registration / passwords)                                    */
/* -------------------------------------------------------------------------- */

@keyframes auth-image-zoom {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

@keyframes auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-body {
    min-height: 100vh;
    background: var(--color-bg-alt, #F5F7FA);
    color: var(--color-text, #202124);
}

/* Shared width helper (trial + legacy centered auth cards) */
.login-container {
    max-width: 26rem;
    width: 90%;
}

.auth-split {
    display: flex;
    min-height: 100vh;
}

.auth-split__animate {
    animation: auth-fade-up 0.55s ease-out both;
}

/* Brand panel (desktop) */
.auth-split__brand {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 56%;
    overflow: hidden;
}

.auth-split__brand-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
}

.auth-split__brand-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: auth-image-zoom 24s ease-in-out infinite alternate;
}

.auth-split__brand-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
    background:
        linear-gradient(
            105deg,
            color-mix(in srgb, var(--brand-blue-dark, #123A8C) 88%, #081a42) 0%,
            color-mix(in srgb, var(--brand-blue-dark, #123A8C) 52%, transparent) 52%,
            color-mix(in srgb, var(--brand-blue-dark, #123A8C) 18%, transparent) 78%,
            transparent 100%
        ),
        linear-gradient(
            0deg,
            color-mix(in srgb, var(--brand-blue-dark, #123A8C) 68%, #000) 0%,
            color-mix(in srgb, var(--brand-blue-dark, #123A8C) 18%, transparent) 42%,
            color-mix(in srgb, var(--brand-blue-dark, #123A8C) 32%, transparent) 100%
        );
}

.auth-split__brand-scrim::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(14vw, 12rem);
    background: linear-gradient(
        90deg,
        transparent 0%,
        color-mix(in srgb, var(--color-bg-alt, #F5F7FA) 40%, transparent) 55%,
        var(--color-bg-alt, #F5F7FA) 100%
    );
}

.auth-split__brand-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 2.5rem 3rem;
    color: #fff;
}

.auth-split__brand-top,
.auth-split__brand-content {
    position: relative;
    z-index: 1;
}

.auth-split__brand-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 1;
    max-width: 28rem;
    padding-bottom: 1.5rem;
}

.auth-split__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-split__logo-img {
    display: block;
    height: 2.75rem;
    width: auto;
    max-width: 16rem;
    object-fit: contain;
}

.auth-split__logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: var(--text-ui, 0.875rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--cta-gradient, var(--accent-color));
    border: 1px solid color-mix(in srgb, white 22%, transparent);
    border-radius: 0.625rem;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--accent-color) 35%, transparent);
}

.auth-split__logo-name {
    font-size: var(--text-lg, 1.0625rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-split__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 1rem;
    font-size: var(--text-micro, 0.6875rem);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-200);
}

.auth-split__eyebrow-line {
    display: block;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1px;
    background: var(--accent-200);
}

.auth-split__headline {
    margin: 0;
    font-size: var(--text-display, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: #fff;
}

@media (min-width: 1100px) {
    .auth-split__headline {
        font-size: 1.75rem;
    }
}

.auth-split__headline strong {
    font-weight: 800;
    color: inherit;
}

.auth-split__tagline {
    margin: 1rem 0 0;
    max-width: 24rem;
    font-size: var(--text-body, 1rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
}

/* Form panel */
.auth-split__form-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin-left: -4rem;
    padding: 2.5rem 2.5rem 2.5rem calc(2.5rem + 4rem);
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-bg-alt, #F5F7FA) 45%, transparent) 0%,
        var(--color-bg-alt, #F5F7FA) 5rem
    );
}

.auth-split__form-panel--scroll {
    align-items: flex-start;
    overflow-y: auto;
}

.auth-form {
    width: 100%;
    max-width: 22.5rem;
}

.auth-form--tall {
    padding-block: 2rem;
}

.auth-form .field-hint {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.auth-form__mobile-brand {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.auth-form__mobile-brand-logo {
    display: block;
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
}

.auth-form__mobile-brand-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: var(--text-ui, 0.875rem);
    font-weight: 700;
    color: #fff;
    background: var(--cta-gradient, var(--accent-color));
    border-radius: 0.625rem;
}

.auth-form__mobile-brand-name {
    font-size: var(--text-lg, 1.0625rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text, #202124);
}

.auth-form__header {
    margin-bottom: 1.75rem;
}

.auth-form__header .page-title {
    margin-bottom: 0.35rem;
}

.auth-form__fields {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.auth-form__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.125rem;
}

@media (min-width: 480px) {
    .auth-form__row--2 {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-form__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-form__meta-link {
    font-size: var(--text-sm, 0.8125rem);
    font-weight: 500;
    color: var(--color-accent, #0A4FFF);
    text-decoration: none;
}

.auth-form__meta-link:hover {
    text-decoration: underline;
}

.auth-form__actions {
    margin-top: 0.25rem;
}

.auth-form__footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border, #e8eaed);
}

.auth-form__links {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    font-size: var(--text-sm, 0.8125rem);
    line-height: 1.45;
    color: var(--color-text-muted, #5f6368);
    text-align: center;
}

.auth-form__links a {
    font-weight: 600;
    color: var(--color-accent, #0A4FFF);
    text-decoration: none;
}

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

.auth-form__errors {
    margin-bottom: 0.25rem;
    padding: 0.875rem 1rem;
    background: var(--red-soft, rgba(197, 57, 43, 0.1));
    border: 1px solid var(--red-border, rgba(197, 57, 43, 0.28));
    border-radius: var(--radius-surface, 12px);
}

.auth-form__errors-title {
    margin: 0 0 0.35rem;
    font-size: var(--text-sm, 0.8125rem);
    font-weight: 600;
    color: var(--red, #c5392b);
}

.auth-form__errors-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: var(--text-sm, 0.8125rem);
    color: var(--red, #c5392b);
}

.auth-form__errors-list li + li {
    margin-top: 0.2rem;
}

.auth-form .checkbox-row {
    font-size: var(--text-sm, 0.8125rem);
    font-weight: 500;
}

.auth-form .checkbox-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--color-accent, #0A4FFF);
    border-radius: 0.25rem;
}

.auth-form__remember {
    width: auto;
    max-width: 100%;
    gap: 0.75rem;
    justify-content: flex-start;
}

.auth-form__remember .switch-track {
    width: 40px;
    height: 22px;
    border-radius: 11px;
}

.auth-form__remember .switch-thumb {
    width: 18px;
    height: 18px;
}

.auth-form__remember input[type="checkbox"].switch-input:checked + .switch-track .switch-thumb {
    transform: translateX(18px);
}

@media (max-width: 767px) {
    .auth-form__mobile-brand {
        display: flex;
    }

    .auth-split__form-panel {
        width: 100%;
        margin-left: 0;
        padding: 1.75rem 1.25rem;
        background: var(--color-bg-alt, #F5F7FA);
    }

    .auth-form {
        max-width: 24rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-split__brand-image,
    .auth-split__animate {
        animation: none;
    }
}
