/* ==========================================================================
   Tabs Authentication Design System & Blade Motion Architecture
   ========================================================================== */

:root {
    --blade-angle: 7deg;
    --blade-anim-duration: 850ms;
    --blade-easing: cubic-bezier(0.65, 0, 0.35, 1);
}

.auth-page-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 1.5rem 2.5rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Outer Shell: Clipped container with state attributes
   -------------------------------------------------------------------------- */
.auth-shell {
    width: 100%;
    max-width: 1020px;
    min-height: 640px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 28px;
    overflow: hidden;
    background: #0E0E14;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    position: relative;
    transform: translateZ(0);
    isolation: isolate;
}

/* Screen reader announcement utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Full-Card Animated Blade Overlay
   -------------------------------------------------------------------------- */
.auth-blade-overlay {
    position: absolute;
    top: -30%;
    bottom: -30%;
    width: 160%;
    background: linear-gradient(135deg, #09090E 0%, #151322 45%, #221B3D 75%, #0B0A12 100%);
    transform: skewX(calc(-1 * var(--blade-angle))) translateX(100%);
    z-index: 10;
    pointer-events: none;
    will-change: transform;
    box-shadow: 
        -20px 0 60px rgba(124, 110, 255, 0.3),
        20px 0 60px rgba(0, 0, 0, 0.8),
        inset 2px 0 0 rgba(255, 255, 255, 0.15),
        inset -2px 0 0 rgba(124, 110, 255, 0.4);
}

.blade-inner-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(124, 110, 255, 0.18) 0%, transparent 65%);
}

/* Dynamic Animation Triggers */
.auth-shell.animating-to-signup .auth-blade-overlay {
    animation: bladeSweepLeft var(--blade-anim-duration) var(--blade-easing) forwards;
}

.auth-shell.animating-to-signin .auth-blade-overlay {
    animation: bladeSweepRight var(--blade-anim-duration) var(--blade-easing) forwards;
}

@keyframes bladeSweepLeft {
    0% {
        transform: skewX(calc(-1 * var(--blade-angle))) translateX(100%);
    }
    50% {
        transform: skewX(calc(-1 * var(--blade-angle))) translateX(0%);
    }
    100% {
        transform: skewX(calc(-1 * var(--blade-angle))) translateX(-100%);
    }
}

@keyframes bladeSweepRight {
    0% {
        transform: skewX(calc(-1 * var(--blade-angle))) translateX(-100%);
    }
    50% {
        transform: skewX(calc(-1 * var(--blade-angle))) translateX(0%);
    }
    100% {
        transform: skewX(calc(-1 * var(--blade-angle))) translateX(100%);
    }
}

/* --------------------------------------------------------------------------
   Dual Panel Slots (Left & Right)
   -------------------------------------------------------------------------- */
.auth-panel {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Panel A: Left Side */
.panel-left {
    background: #151422;
    color: #FFFFFF;
}

/* Panel B: Right Side */
.panel-right {
    background: linear-gradient(145deg, #0C0C12 0%, #151422 100%);
    color: #FFFFFF;
}

/* In signup mode, the backgrounds swap visually to match the new blade position */
.auth-shell[data-mode="signup"] .panel-left {
    background: linear-gradient(145deg, #0C0C12 0%, #151422 100%);
    color: #FFFFFF;
}

.auth-shell[data-mode="signup"] .panel-right {
    background: #151422;
    color: #FFFFFF;
}

/* Content Slot Containers inside Panels */
.panel-content {
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    width: 100%;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-content.hidden {
    display: none;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
}

.auth-shell.animating .panel-content {
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Brand Badges & Headers
   -------------------------------------------------------------------------- */
.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    align-self: flex-start;
}

.auth-brand-badge img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(124, 110, 255, 0.25);
}

.auth-form-header {
    margin-bottom: 1.5rem;
}

.auth-form-header h1,
.auth-form-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: inherit;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.auth-form-header p {
    color: #A0A0B0;
    font-size: 0.92rem;
    line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Form Fields & Controls
   -------------------------------------------------------------------------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.form-field label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #E8E8F0;
    padding-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 0.8rem 0.95rem;
    background: #0C0C12;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #71718A;
    opacity: 1;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    background: #12121A;
    box-shadow: 0 0 0 4px rgba(124, 110, 255, 0.15);
}

.input-wrapper input.invalid {
    border-color: #E53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #A0A0B0;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--primary-color);
    background: rgba(124, 110, 255, 0.08);
}

.toggle-password-btn:focus-visible {
    outline: 2px solid var(--primary-color);
}

/* Field Inline Errors */
.field-error {
    font-size: 0.78rem;
    color: #F87171;
    font-weight: 500;
    display: none;
    margin-top: 2px;
}

.field-error.visible {
    display: block;
}

/* Password Requirements Checklist */
.password-requirements {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.requirements-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #DCDCE8;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 0.6rem;
}

.req-item {
    font-size: 0.76rem;
    color: #A0A0B0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.req-item::before {
    content: '•';
    font-size: 0.9rem;
    color: #A0A0B0;
}

.req-item.valid {
    color: #4ADE80;
    font-weight: 600;
}

.req-item.valid::before {
    content: '✓';
    color: #4ADE80;
    font-size: 0.8rem;
}

/* Options Bar (Remember Me / Forgot Link) */
.form-options-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #A0A0B0;
    cursor: pointer;
    user-select: none;
    font-size: 0.86rem;
}

.checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
}

.forgot-pass-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.86rem;
}

.forgot-pass-link:hover {
    text-decoration: underline;
}

/* Terms & Privacy Checkbox Group */
.terms-checkbox-group {
    margin-top: 0.15rem;
}

.terms-text {
    font-size: 0.8rem;
    color: #A0A0B0;
    line-height: 1.4;
}

.terms-text a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

/* Form Action Button */
.auth-submit-btn {
    width: 100%;
    min-height: 48px;
    padding: 0.88rem;
    background: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(124, 110, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    margin-top: 0.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(124, 110, 255, 0.45);
    background: #6D5EFA;
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Alert Notification Banner */
.auth-alert-banner {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 1rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-alert-banner.error {
    display: block;
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid #F87171;
    color: #FCA5A5;
}

.auth-alert-banner.success {
    display: block;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid #34D399;
    color: #6EE7B7;
}

/* Switch Mode Toggle Link */
.auth-switch-text {
    text-align: center;
    font-size: 0.88rem;
    color: #A0A0B0;
    margin-top: 0.75rem;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 700;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0 4px;
    text-decoration: underline;
    transition: color 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-switch-btn:hover {
    color: #5B4EFA;
}

/* --------------------------------------------------------------------------
   Supporting Brand Messaging Styles
   -------------------------------------------------------------------------- */
.support-content {
    position: relative;
    z-index: 2;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.support-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(124, 110, 255, 0.12);
    border: 1px solid rgba(124, 110, 255, 0.25);
    border-radius: 50px;
    color: #B2A8FF;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    align-self: flex-start;
}

.support-heading {
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFFFFF 0%, #D0C9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.support-copy {
    color: #A0A0B0;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
    max-width: 400px;
}

.support-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.5rem;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.highlight-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.highlight-text {
    font-size: 0.9rem;
    color: #C4C4D4;
    line-height: 1.4;
}

.support-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Accessibility Focus States
   -------------------------------------------------------------------------- */
input:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* --------------------------------------------------------------------------
   Reduced Motion Support
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    :root {
        --blade-anim-duration: 0.01ms !important;
    }
    
    .auth-blade-overlay {
        display: none !important;
    }

    .panel-content {
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Mobile-First Responsive Layout & Vertical Sweep Animation
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .auth-page-wrapper {
        padding: 80px 1rem 2rem 1rem;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 24px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    }

    /* Single column panel order: active panel shows form first */
    .panel-left, .panel-right {
        min-height: 520px;
    }

    .auth-shell[data-mode="signin"] .panel-right {
        display: none;
    }

    .auth-shell[data-mode="signup"] .panel-left {
        display: none;
    }

    .panel-content {
        padding: 2.25rem 1.5rem;
    }

    .input-wrapper input {
        font-size: 16px; /* Prevents auto zoom on mobile browsers */
        padding: 0.85rem 1rem;
    }

    /* Vertical Blade Sweep Overlay for Mobile */
    .auth-blade-overlay {
        top: 0;
        left: -30%;
        bottom: 0;
        width: 160%;
        height: 160%;
        transform: skewY(calc(-1 * var(--blade-angle))) translateY(100%);
    }

    @keyframes bladeSweepLeft {
        0% {
            transform: skewY(calc(-1 * var(--blade-angle))) translateY(100%);
        }
        50% {
            transform: skewY(calc(-1 * var(--blade-angle))) translateY(0%);
        }
        100% {
            transform: skewY(calc(-1 * var(--blade-angle))) translateY(-100%);
        }
    }

    @keyframes bladeSweepRight {
        0% {
            transform: skewY(calc(-1 * var(--blade-angle))) translateY(-100%);
        }
        50% {
            transform: skewY(calc(-1 * var(--blade-angle))) translateY(0%);
        }
        100% {
            transform: skewY(calc(-1 * var(--blade-angle))) translateY(100%);
        }
    }

    .support-heading {
        font-size: 1.7rem;
    }

    .support-copy {
        font-size: 0.95rem;
    }

    .requirements-list {
        grid-template-columns: 1fr;
    }
}
