/* ==========================================================================
   V5 SMOOTHEST COOL LOGIN & SIGN-UP PAGE - CYBER RED GLASSMORPHISM
   Closely matching reference design
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #090204;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    color: #ffffff;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ---- TOP HEADER ---- */
.top-header {
    text-align: center;
    margin-bottom: 30px;
    z-index: 10;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-title {
    font-family: 'Xirod', 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #ffffff 0%, #ff4068 50%, #ff0033 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    filter: drop-shadow(0 0 18px rgba(255, 30, 66, 0.6));
    text-transform: uppercase;
}

.header-line {
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff1e42, transparent);
    margin-top: 10px;
    border-radius: 2px;
    box-shadow: 0 0 8px #ff1e42;
    position: relative;
}

.header-line::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff1e42, 0 0 18px #ff1e42;
}

/* =========================================================================
   MAIN CARD CONTAINER
   ========================================================================= */
.container {
    position: relative;
    overflow: hidden;
    width: 820px;
    max-width: 94vw;
    min-height: 480px;
    z-index: 10;
    border-radius: 20px;
    background: rgba(18, 8, 12, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 42, 85, 0.25);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(255, 30, 66, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    perspective: 1200px;
    transform-style: preserve-3d;
}

/* =========================================================================
   FORM CONTAINERS
   ========================================================================= */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.55s cubic-bezier(0.65, 0, 0.35, 1);
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

form {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 45px;
    height: 100%;
    text-align: center;
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 22px;
    letter-spacing: 0.5px;
}

/* ---- INPUT FIELDS ---- */
.input-field {
    position: relative;
    width: 100%;
    margin: 7px 0;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a6878;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    z-index: 1;
}

.input-field input {
    background: rgba(25, 12, 18, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px 12px 44px;
    border-radius: 10px;
    width: 100%;
    outline: none;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.input-field input::placeholder {
    color: #6a5560;
}

.input-field input:focus {
    border-color: rgba(255, 30, 66, 0.6);
    box-shadow: 0 0 12px rgba(255, 30, 66, 0.2);
    background: rgba(35, 16, 25, 0.85);
}

.input-field:focus-within .input-icon {
    color: #ff1e42;
}

/* ---- ACTION BUTTON ---- */
.btn-action {
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #ff2a55 0%, #b3002d 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 40px;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 16px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 5px 18px rgba(255, 30, 66, 0.4);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 30, 66, 0.6);
    background: linear-gradient(135deg, #ff4068 0%, #cc0033 100%);
}

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

/* ---- LINKS ---- */
.switch-text {
    color: #a09098;
    font-size: 0.82rem;
    margin-top: 16px;
}

.switch-text a {
    color: #ff1e42;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.switch-text a:hover {
    color: #ff5570;
    text-decoration: underline;
}

.forgot-link {
    color: #ff1e42;
    font-size: 0.8rem;
    text-decoration: none;
    margin-top: 10px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #ff5570;
    text-decoration: underline;
}

/* ---- FORGOT / RESET FLOW COMPONENTS ---- */
.form-desc {
    color: #a09098;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
    max-width: 290px;
}

.inline-error {
    color: #ff3355;
    font-size: 0.8rem;
    font-weight: 600;
    min-height: 18px;
    margin: 2px 0;
    text-align: center;
    transition: all 0.3s ease;
}

.status-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2a55 0%, #990026 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.4rem;
    margin-bottom: 12px;
    box-shadow: 0 0 25px rgba(255, 30, 66, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 42, 85, 0.85);
}

.status-icon-badge.success-glow {
    background: linear-gradient(135deg, #ff2a55 0%, #880020 100%);
    box-shadow: 0 0 25px rgba(255, 30, 66, 0.7), inset 0 0 10px rgba(255, 42, 85, 0.4);
    border: 2px solid #ff2a55;
}

.cyber-check-svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.password-toggle-field input {
    padding-right: 44px;
}

.eye-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #8a6878;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    z-index: 2;
}

.eye-toggle-btn:hover {
    color: #ff1e42;
}

.strength-meter-wrap {
    width: 100%;
    margin: 3px 0 6px 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.strength-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
    background-color: transparent;
}

.strength-text {
    font-size: 0.75rem;
    color: #a09098;
    text-align: left;
    padding-left: 2px;
}

.resend-link-btn {
    background: transparent;
    border: none;
    color: #ff1e42;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s ease;
}

.resend-link-btn:disabled {
    color: #706068;
    cursor: not-allowed;
}

.back-to-signin-link {
    color: #ff1e42;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 14px;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

.back-to-signin-link:hover {
    color: #ff5570;
    text-decoration: underline;
}

/* =========================================================================
   SIGN IN & SIGN UP PANEL POSITIONING (3D PERSPECTIVE CROSSFADE)
   ========================================================================= */
.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 3;
    opacity: 1;
    visibility: visible;
    transform: translateX(0%) translateZ(0) rotateY(0deg);
    pointer-events: all;
    filter: blur(0px);
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                visibility 0.6s;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(60%) translateZ(-70px) rotateY(-10deg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    filter: blur(3px);
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    visibility: hidden;
    z-index: 1;
    pointer-events: none;
    transform: translateX(40%) translateZ(-70px) rotateY(10deg);
    filter: blur(3px);
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                visibility 0.6s;
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%) translateZ(0) rotateY(0deg);
    opacity: 1;
    visibility: visible;
    z-index: 3;
    pointer-events: all;
    filter: blur(0px);
}

/* ---- SIGN UP SUCCESS VIEW ---- */
.signup-success-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 45px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateX(40px) translateZ(-50px) rotateY(10deg);
    filter: blur(4px);
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                visibility 0.6s;
}

.sign-up-container form {
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                visibility 0.6s;
}

.sign-up-container.show-success form {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: translateX(-40px) translateZ(-50px) rotateY(-10deg) !important;
    filter: blur(4px) !important;
}

.sign-up-container.show-success .signup-success-view {
    opacity: 1 !important;
    pointer-events: all !important;
    visibility: visible !important;
    transform: translateX(0) translateZ(0) rotateY(0deg) !important;
    filter: blur(0) !important;
}

/* ---- FORGOT / RESET FLOW FORM STATES ---- */
.forgot-container,
.check-email-container,
.reset-password-container,
.reset-success-container {
    left: 0;
    width: 50%;
    opacity: 0;
    visibility: hidden;
    display: none;
    z-index: 1;
    pointer-events: none;
    transform: translateX(40px) translateZ(-60px) rotateY(10deg);
    filter: blur(4px);
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.55s cubic-bezier(0.65, 0, 0.35, 1),
                visibility 0.6s;
}

/* Active state for the currently visible form */
.form-container.active-form {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 4 !important;
    pointer-events: all !important;
    transform: translateX(0%) translateZ(0) rotateY(0deg) !important;
    filter: blur(0px) !important;
}

/* Inactive state for any hidden form */
.form-container.form-inactive {
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1 !important;
    pointer-events: none !important;
    transform: translateX(-40px) translateZ(-60px) rotateY(-10deg) !important;
    filter: blur(4px) !important;
}

/* =========================================================================
   DIAGONAL OVERLAY PANEL (3D PERSPECTIVE SLIDING GLASS)
   Full-width container with clip-path diagonal divider.
   Login mode: overlay on RIGHT, diagonal from 30% top to 70% bottom.
   Sign-up mode: overlay on LEFT, mirrored diagonal.
   ========================================================================= */
.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 100;
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 70% 100%);
    transform: perspective(1200px) rotateY(0deg) translateZ(0);
    transition: clip-path 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                transform 0.62s cubic-bezier(0.65, 0, 0.35, 1);
    transform-origin: center center;
    transform-style: preserve-3d;
    will-change: clip-path, transform;
}

.container.right-panel-active .overlay-container {
    clip-path: polygon(0 0, 70% 0, 30% 100%, 0 100%);
    transform: perspective(1200px) rotateY(0deg) translateZ(0);
}

.overlay {
    background: linear-gradient(135deg,
        rgba(45, 16, 28, 0.94) 0%,
        rgba(22, 7, 14, 0.97) 50%,
        rgba(35, 12, 22, 0.94) 100%);
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

/* ---- Overlay content panels with 3D Depth Shift ---- */
.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.58s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.58s cubic-bezier(0.65, 0, 0.35, 1);
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

.overlay-left {
    left: 0;
    transform: translateX(-30%) translateZ(-40px) rotateY(10deg);
    opacity: 0;
    filter: blur(3px);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0) translateZ(20px) rotateY(0deg);
    opacity: 1;
    filter: blur(0px);
}

.overlay-right {
    right: 0;
    transform: translateX(0) translateZ(20px) rotateY(0deg);
    opacity: 1;
    filter: blur(0px);
}

.container.right-panel-active .overlay-right {
    transform: translateX(30%) translateZ(-40px) rotateY(-10deg);
    opacity: 0;
    filter: blur(3px);
}

.overlay-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 14px;
    line-height: 1.2;
    letter-spacing: 1px;
}

.overlay-desc {
    font-size: 0.85rem;
    color: #c0b0b8;
    line-height: 1.6;
    max-width: 260px;
}

/* =========================================================================
   DIAGONAL NEON GLOW LINE (SVG)
   ========================================================================= */
.diagonal-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150;
    pointer-events: none;
    transform-origin: center center;
    transition: transform 0.62s cubic-bezier(0.65, 0, 0.35, 1),
                filter 0.62s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

.diagonal-glow line {
    stroke-width: 0.35;
    filter: drop-shadow(0 0 3px rgba(255, 30, 66, 0.9))
            drop-shadow(0 0 8px rgba(255, 30, 66, 0.5));
}

/* Flip the glow line when switching to sign-up */
.container.right-panel-active .diagonal-glow {
    transform: scaleX(-1);
}

/* =========================================================================
   RESPONSIVE - DEDICATED MOBILE UI (NO CHANGES TO DESKTOP)
   ========================================================================= */
@media (max-width: 768px) {
    body {
        padding: 16px 10px;
        overflow-y: auto;
        min-height: 100vh;
        justify-content: flex-start;
    }

    .top-header {
        margin-top: 10px;
        margin-bottom: 18px;
    }

    .header-title {
        font-size: 1.85rem;
        letter-spacing: 4px;
        text-align: center;
        max-width: 90vw;
    }

    .header-line {
        width: 90px;
        margin-top: 8px;
    }

    /* Mobile Glassmorphic Card Container: Compact with sleek curved edges */
    .container {
        width: 88vw;
        max-width: 350px;
        min-height: 480px;
        border-radius: 28px; /* Pronounced curved edges */
        margin: 8px auto 25px auto;
        background: rgba(20, 8, 14, 0.45); /* More translucent to reveal particles */
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(255, 42, 85, 0.35);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 30, 66, 0.25);
        position: relative;
    }

    /* Diagonal accent corner on mobile card */
    .container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 55px;
        height: 55px;
        background: linear-gradient(135deg, transparent 50%, rgba(255, 30, 66, 0.25) 50%);
        clip-path: polygon(100% 0, 0 0, 100% 100%);
        border-top-right-radius: 28px;
        pointer-events: none;
        z-index: 20;
    }

    /* Hide desktop-only overlay panel & desktop diagonal SVG line on mobile */
    .overlay-container {
        display: none !important;
    }

    .diagonal-glow {
        display: none !important;
    }

    /* Full-width responsive form containers with smooth 3D slide */
    .form-container {
        width: 100%;
        left: 0;
        top: 0;
        height: 100%;
        padding: 0;
        transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1),
                    opacity 0.52s cubic-bezier(0.65, 0, 0.35, 1),
                    filter 0.52s cubic-bezier(0.65, 0, 0.35, 1);
        transform-style: preserve-3d;
        will-change: transform, opacity;
    }

    form {
        padding: 28px 22px;
        width: 100%;
    }

    .form-title {
        font-size: 1.6rem;
        margin-bottom: 16px;
    }

    .input-field {
        margin: 6px 0;
    }

    .input-field input {
        padding: 11px 14px 11px 40px;
        font-size: 0.9rem;
        border-radius: 14px;
        background: rgba(28, 12, 20, 0.7);
    }

    .btn-action {
        padding: 12px 24px;
        font-size: 0.92rem;
        margin-top: 15px;
        border-radius: 30px;
    }

    .switch-text {
        font-size: 0.82rem;
        margin-top: 15px;
    }

    .forgot-link {
        font-size: 0.8rem;
        margin-top: 10px;
    }

    /* Sign-In State on Mobile with 3D Depth */
    .sign-in-container {
        transform: translateX(0) translateZ(0) rotateY(0deg);
        opacity: 1;
        pointer-events: all;
        z-index: 5;
        filter: blur(0px);
    }

    .container.right-panel-active .sign-in-container {
        transform: translateX(-100%) translateZ(-40px) rotateY(8deg);
        opacity: 0;
        pointer-events: none;
        z-index: 1;
        filter: blur(3px);
    }

    /* Sign-Up State on Mobile with 3D Depth */
    .sign-up-container {
        transform: translateX(100%) translateZ(-40px) rotateY(-8deg);
        opacity: 0;
        pointer-events: none;
        z-index: 1;
        filter: blur(3px);
    }

    .container.right-panel-active .sign-up-container {
        transform: translateX(0) translateZ(0) rotateY(0deg);
        opacity: 1;
        pointer-events: all;
        z-index: 5;
        filter: blur(0px);
        animation: none;
    }
}

/* Extra small mobile devices (e.g., iPhone SE, Galaxy Fold) */
@media (max-width: 380px) {
    .header-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .container {
        width: 92vw;
        max-width: 320px;
        min-height: 460px;
        border-radius: 24px;
    }

    form {
        padding: 24px 16px;
    }

    .form-title {
        font-size: 1.45rem;
        margin-bottom: 14px;
    }

    .input-field input {
        padding: 10px 12px 10px 38px;
        font-size: 0.85rem;
    }

    .btn-action {
        padding: 11px 18px;
        font-size: 0.88rem;
    }
}
