/* ============================================
   Authentication pages — split-screen layout
   Loaded only by views that opt in via the
   "Styles" section of _AuthLayout.
   ============================================ */

/* Break out of the centred container _AuthLayout provides. */
.auth-page .page-center {
    padding: 0;
    min-height: 100vh;
    display: block;
}

.auth-page main.container {
    max-width: 100%;
    padding: 0;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

/* ============================================
   Brand pane (hidden below 992px)
   ============================================ */
.auth-hero {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 4rem;
    color: #fff;
    background: linear-gradient(150deg, #06346b 0%, var(--tblr-primary, #0054a6) 55%, #1c7ed6 100%);
}

.auth-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    pointer-events: none;
}

.auth-hero-glow-a {
    width: 460px;
    height: 460px;
    top: -150px;
    left: -130px;
    background: rgba(255, 255, 255, 0.35);
    animation: auth-drift 18s ease-in-out infinite alternate;
}

.auth-hero-glow-b {
    width: 380px;
    height: 380px;
    bottom: -130px;
    right: -90px;
    background: rgba(120, 190, 255, 0.45);
    animation: auth-drift 22s ease-in-out infinite alternate-reverse;
}

.auth-hero-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
    mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
    pointer-events: none;
}

@keyframes auth-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(40px, 30px, 0) scale(1.15); }
}

.auth-hero-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    max-width: 30rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-hero-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 3rem;
}

.auth-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
}

.auth-hero-name {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.auth-hero-tag {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
}

.auth-hero-headline {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 2rem;
    color: #fff;
}

.auth-hero-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-hero-points li {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
}

.auth-hero-points i {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-hero-footer {
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Form pane
   ============================================ */
.auth-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--tblr-body-bg, #f6f8fb);
}

.auth-box {
    width: 100%;
    max-width: 25rem;
    animation: auth-rise 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Compact brand lockup — replaces the hero pane on narrow screens. */
.auth-brand-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand-compact .auth-logo {
    background: var(--tblr-primary, #0054a6);
    border-color: transparent;
    color: #fff;
    margin-bottom: 0.75rem;
}

.auth-brand-compact-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--tblr-body-color, #1e293b);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin: 0 0 0.25rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--tblr-secondary, #6c7a91);
    margin: 0 0 1.75rem;
}

/* Validation summary — render as an alert, hide when there is nothing to say. */
.auth-form .validation-summary-valid {
    display: none;
}

.auth-form .validation-summary-errors {
    background: rgba(214, 57, 57, 0.08);
    border: 1px solid rgba(214, 57, 57, 0.28);
    color: #b02a2a;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    animation: auth-shake 0.35s ease-out;
}

.auth-form .validation-summary-errors ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-form .validation-summary-errors ul li:only-child {
    list-style: none;
    margin-left: -1.1rem;
}

@keyframes auth-shake {
    0%   { opacity: 0; transform: translateX(-8px); }
    60%  { opacity: 1; transform: translateX(4px); }
    100% { opacity: 1; transform: translateX(0); }
}

.auth-form .form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--tblr-body-color, #1e293b);
    margin-bottom: 0.375rem;
}

.auth-form .input-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
}

.auth-form .input-group-text {
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    border-color: var(--tblr-border-color, #dadfe5);
    color: var(--tblr-secondary, #6c7a91);
    width: 2.75rem;
    justify-content: center;
}

.auth-form .form-control {
    height: 2.875rem;
    border-color: var(--tblr-border-color, #dadfe5);
}

.auth-form .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb, 0, 84, 166), 0.16);
    border-color: var(--tblr-primary, #0054a6);
}

.auth-form .input-group:focus-within .input-group-text {
    border-color: var(--tblr-primary, #0054a6);
    color: var(--tblr-primary, #0054a6);
}

.auth-toggle-password {
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    border: 1px solid var(--tblr-border-color, #dadfe5);
    border-left: 0;
    color: var(--tblr-secondary, #6c7a91);
    width: 2.75rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.auth-toggle-password:hover {
    color: var(--tblr-primary, #0054a6);
}

.auth-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.8125rem;
}

.auth-meta-row .form-check {
    margin: 0;
}

.auth-submit {
    width: 100%;
    height: 2.875rem;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 18px rgba(var(--tblr-primary-rgb, 0, 84, 166), 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(var(--tblr-primary-rgb, 0, 84, 166), 0.35);
}

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

.auth-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--tblr-secondary, #6c7a91);
}

.auth-copyright {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--tblr-secondary, #6c7a91);
}

/* ============================================
   Demo accounts (Development only)
   ============================================ */
.auth-demo {
    margin-top: 1.5rem;
    border: 1px dashed var(--tblr-border-color, #dadfe5);
    border-radius: 12px;
    background: var(--tblr-bg-surface, #fff);
    overflow: hidden;
}

.auth-demo-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tblr-secondary, #6c7a91);
    cursor: pointer;
}

.auth-demo-toggle .auth-demo-caret {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.auth-demo.is-open .auth-demo-caret {
    transform: rotate(180deg);
}

.auth-demo-list {
    display: none;
    padding: 0 0.5rem 0.5rem;
    max-height: 17rem;
    overflow-y: auto;
}

.auth-demo.is-open .auth-demo-list {
    display: block;
}

.auth-demo-user {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-demo-user:hover {
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    border-color: var(--tblr-primary, #0054a6);
}

.auth-demo-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--tblr-primary, #0054a6), #1c7ed6);
}

.auth-demo-info {
    min-width: 0;
    flex: 1;
}

.auth-demo-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tblr-body-color, #1e293b);
    line-height: 1.3;
}

.auth-demo-email {
    font-size: 0.75rem;
    color: var(--tblr-secondary, #6c7a91);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-demo-role {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    color: var(--tblr-primary, #0054a6);
    background: rgba(var(--tblr-primary-rgb, 0, 84, 166), 0.1);
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 992px) {
    .auth-split {
        grid-template-columns: 1.05fr 1fr;
    }

    .auth-hero {
        display: block;
    }

    .auth-brand-compact,
    .auth-copyright {
        display: none;
    }
}

@media (min-width: 1400px) {
    .auth-hero-headline {
        font-size: 2.875rem;
    }
}

@media (max-width: 575.98px) {
    .auth-pane {
        padding: 2rem 1.25rem;
    }

    .auth-title {
        font-size: 1.3125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-box,
    .auth-hero-glow,
    .auth-form .validation-summary-errors {
        animation: none !important;
    }
}
