.slams-layout-user .slams-main {
    position: relative;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: clamp(1.2rem, 2.4vw, 1.8rem);
    align-items: stretch;
    min-height: min(76vh, 760px);
    padding: clamp(0.4rem, 1vw, 0.8rem) 0;
}

.auth-showcase,
.auth-panel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
}

.auth-showcase {
    min-height: 640px;
    border: 1px solid color-mix(in srgb, var(--slams-hero-border) 92%, transparent);
    background: var(--slams-hero-bg);
    box-shadow: var(--slams-hero-shadow);
    isolation: isolate;
}

.auth-showcase-media,
.auth-showcase-overlay {
    position: absolute;
    inset: 0;
}

.auth-showcase-media {
    border-radius: inherit;
}

.auth-showcase-overlay {
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(6, 14, 11, 0.12) 0%, rgba(6, 14, 11, 0.18) 34%, rgba(6, 14, 11, 0.66) 100%),
        linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.02));
}

:root[data-theme="light"] .auth-showcase-overlay {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(12, 27, 22, 0.1) 38%, rgba(12, 27, 22, 0.54) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(15, 118, 110, 0.08));
}

.auth-showcase-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: clamp(1.35rem, 2.8vw, 1.9rem);
    color: #fff;
}

.auth-panel-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 18px;
    background: color-mix(in srgb, var(--slams-primary) 24%, rgba(255, 255, 255, 0.74));
    color: var(--slams-heading);
    font-size: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-panel-badge-title {
    font-family: var(--slams-font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-panel-badge-copy {
    font-size: 0.82rem;
    opacity: 0.8;
}

.auth-showcase-copy {
    max-width: min(84%, 420px);
    padding: 1.3rem 1.35rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.24) 58%, rgba(255, 255, 255, 0.1)),
        rgba(4, 13, 10, 0.2);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    transition: opacity 0.34s ease, transform 0.34s ease;
}

.auth-showcase-copy:not([data-auth-copy="login"]) {
    display: none;
}

.auth-shell[data-auth-mode="register"] .auth-showcase-copy[data-auth-copy="login"] {
    display: none;
}

.auth-shell[data-auth-mode="register"] .auth-showcase-copy[data-auth-copy="register"] {
    display: block;
}

.auth-shell[data-auth-mode="login"] .auth-showcase-copy[data-auth-copy="login"] {
    display: block;
}

.auth-showcase-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: #31433c;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-showcase-copy h1 {
    margin: 0.85rem 0 0.5rem;
    color: #f8fcfa;
    font-size: clamp(2.1rem, 4vw, 3rem);
    line-height: 1.02;
}

.auth-showcase-copy p,
.auth-showcase-theme-note {
    margin: 0;
    color: rgba(244, 249, 246, 0.9);
    font-size: 0.95rem;
}

.auth-panel {
    min-height: 640px;
    padding: clamp(1.1rem, 2.1vw, 1.5rem);
    border: 1px solid var(--slams-border);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--slams-surface-solid) 86%, transparent), color-mix(in srgb, var(--slams-surface) 94%, transparent)),
        var(--slams-surface);
    box-shadow: var(--slams-shadow-lift);
}

.auth-panel-header {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.auth-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    width: fit-content;
}

.auth-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    padding: 0.3rem;
    border: 1px solid var(--slams-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--slams-bg-muted) 88%, transparent);
}

.auth-mode-switch-btn {
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--slams-muted);
    font-weight: 700;
    font-size: 0.96rem;
    padding: 0.82rem 1rem;
    transition: background-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

.auth-mode-switch-btn.is-active,
.auth-mode-switch-btn[aria-selected="true"] {
    background: linear-gradient(135deg, var(--slams-primary), color-mix(in srgb, var(--slams-primary-strong) 72%, var(--slams-primary)));
    color: #fff;
    box-shadow: 0 14px 26px rgba(15, 118, 110, 0.22);
}

:root[data-theme="dark"] .auth-mode-switch-btn.is-active,
:root[data-theme="dark"] .auth-mode-switch-btn[aria-selected="true"] {
    color: #06231d;
}

.auth-form-stage {
    position: relative;
    transition: height 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-form-view {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px) scale(0.985);
    transform-origin: center top;
    transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-form-view.is-active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.auth-form-copy {
    margin-bottom: 1rem;
}

.auth-form-copy h2 {
    margin: 0;
    font-size: clamp(1.7rem, 2.8vw, 2.15rem);
}

.auth-form-copy p {
    margin: 0.32rem 0 0;
    color: var(--slams-muted);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.95rem;
    border-radius: 18px;
    border-width: 1px;
}

.auth-form {
    display: grid;
    gap: 0.95rem;
}

.auth-field {
    display: grid;
    gap: 0.42rem;
}

.auth-field .form-label {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--slams-heading);
}

.auth-field .form-control {
    min-height: 3.45rem;
    border-radius: 16px;
    border: 1px solid var(--slams-border);
    background: color-mix(in srgb, var(--slams-surface-solid) 92%, transparent);
    color: var(--slams-text);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--slams-glass-highlight) 32%, transparent);
}

.auth-field .form-control:focus {
    border-color: color-mix(in srgb, var(--slams-primary) 56%, var(--slams-border));
    box-shadow: var(--slams-focus);
}

.auth-field .form-control.is-invalid {
    border-color: color-mix(in srgb, var(--slams-danger, #dc2626) 72%, var(--slams-border));
    box-shadow: 0 0 0 0.16rem color-mix(in srgb, var(--slams-danger, #dc2626) 16%, transparent);
}

.auth-field-error {
    color: var(--slams-danger, #dc2626);
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-field-hint {
    color: var(--slams-muted);
    font-size: 0.8rem;
}

/* Row containing the toggle label and forgot-password link */
.auth-form-row,
.auth-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* The label wraps the hidden input + track + text */
.auth-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
    max-width: 100%;
}

/* sr-only: visually hidden but accessible to keyboard and screen readers */
.auth-remember-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Pill track — pixel sizes so no rem scaling can distort it */
.auth-remember-track {
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    width: 36px;
    height: 20px;
    min-width: 36px;
    min-height: 20px;
    border-radius: 10px;
    background-color: #9ca3af;
    transition: background-color 0.2s ease;
    vertical-align: middle;
}

/* Sliding knob */
.auth-remember-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.18s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Checked state */
.auth-remember-input:checked ~ .auth-remember-track {
    background-color: var(--slams-primary);
}

.auth-remember-input:checked ~ .auth-remember-track::after {
    left: 19px;
}

/* Focus ring */
.auth-remember-input:focus ~ .auth-remember-track {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--slams-primary) 22%, transparent);
}

.auth-inline-link,
.auth-form-note a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--slams-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 3.5rem;
    border: 0;
    border-radius: 16px;
    padding: 0.95rem 1.2rem;
    background: linear-gradient(135deg, var(--slams-primary), color-mix(in srgb, var(--slams-primary-strong) 72%, var(--slams-primary)));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 18px 30px rgba(15, 118, 110, 0.22);
    transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

:root[data-theme="dark"] .auth-submit-btn {
    color: #06231d;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.04);
    box-shadow: 0 22px 34px rgba(15, 118, 110, 0.26);
}

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

.auth-form-note {
    margin: 0;
    padding-top: 0.15rem;
    color: var(--slams-muted);
    text-align: center;
}

.auth-password-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 0.48rem;
    margin-top: 0.12rem;
}

.auth-password-rule {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid var(--slams-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--slams-bg-muted) 84%, transparent);
    color: var(--slams-muted);
    font-size: 0.76rem;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.auth-password-rule.met {
    border-color: color-mix(in srgb, var(--slams-success) 40%, var(--slams-border));
    background: color-mix(in srgb, var(--slams-success-soft) 80%, transparent);
    color: var(--slams-success);
}

.auth-password-rule i {
    font-size: 0.72rem;
}

.password-wrapper > .toggle-password {
    color: var(--slams-muted);
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-showcase,
    .auth-panel {
        min-height: auto;
    }

    .auth-showcase {
        min-height: 420px;
    }

    .auth-showcase-copy {
        max-width: min(92%, 480px);
    }
}

@media (max-width: 767.98px) {
    .auth-shell {
        gap: 1rem;
    }

    .auth-showcase {
        min-height: 340px;
    }

    .auth-showcase-content,
    .auth-panel {
        padding: 1rem;
    }

    .auth-showcase-copy {
        max-width: 100%;
        padding: 1rem;
    }

    .auth-form-row,
    .auth-bottom-row {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.55rem;
    }

    .auth-remember-label,
    .auth-inline-link {
        width: auto;
        max-width: 100%;
    }
}
