/* Auth CSS for Sliding Panel and OTP */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    background: #f4f7fa;
    font-family: 'Inter', sans-serif;
}

.auth-card {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    width: 900px;
    max-width: 100%;
    min-height: 550px;
}

.auth-panel {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    padding: 0 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.auth-panel h2 { margin-bottom: 20px; color: #1e293b; }
.auth-panel p { font-size: 14px; color: #64748b; margin-bottom: 30px; }
.auth-panel form { width: 100%; max-width: 320px; display: flex; flex-direction: column; }
.auth-panel input {
    background-color: #f1f5f9;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 8px;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.auth-panel button {
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
    cursor: pointer;
    margin-top: 15px;
}
.auth-panel button:active { transform: scale(0.95); }

/* Left & Right panels positioning */
.login-panel {
    left: 0;
    width: 50%;
    z-index: 2;
}

.register-panel {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

/* Overlay Container */
.auth-overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-overlay {
    background: var(--primary-color);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.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%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left { transform: translateX(-20%); }
.overlay-right { right: 0; transform: translateX(0); }
.overlay-panel button.ghost {
    background-color: transparent;
    border-color: #FFFFFF;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid #FFF;
    color: #FFF;
    font-size: 14px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

/* Animations for Sliding */
.auth-card.right-panel-active .login-panel {
    transform: translateX(100%);
}
.auth-card.right-panel-active .register-panel {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}
.auth-card.right-panel-active .auth-overlay-container {
    transform: translateX(-100%);
}
.auth-card.right-panel-active .auth-overlay {
    transform: translateX(50%);
}
.auth-card.right-panel-active .overlay-left {
    transform: translateX(0);
}
.auth-card.right-panel-active .overlay-right {
    transform: translateX(20%);
}

@keyframes show {
    0%, 49.99% { opacity: 0; z-index: 1; }
    50%, 100% { opacity: 1; z-index: 5; }
}

/* OTP Screen */
.otp-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #1e293b;
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease-in-out;
}
.otp-screen.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.otp-screen h2 { margin-bottom: 10px; font-size: 28px; font-weight: 700; color: var(--primary-color); }
.otp-screen p { color: #64748b; font-size: 14px; margin-bottom: 40px; }

/* OTP Diamond Layout */
.otp-diamond {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto 40px auto;
    transition: transform 1s ease-in-out;
}

.otp-diamond.verifying {
    animation: spinDiamond 2s linear infinite;
}

@keyframes spinDiamond {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.otp-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 280px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.otp-diamond.verifying .otp-svg {
    opacity: 1;
}

.otp-trace {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
    stroke-linecap: round;
    transition: all 0.3s;
}

/* Animated Trace */
.otp-trace.active-trace {
    stroke: var(--primary-color);
    stroke-dasharray: 141; /* length of line ~ 141px */
    stroke-dashoffset: 141;
    animation: draw 0.6s ease forwards;
    filter: drop-shadow(0 0 6px rgba(41, 94, 138, 0.5));
}

@keyframes draw {
    from { stroke-dashoffset: 141; }
    to { stroke-dashoffset: 0; }
}

.otp-nodes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.otp-input {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    color: #1e293b;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* STRAIGHT LINE POSITIONS (Default) */
#otp1 { top: 110px; left: 0px; }
#otp2 { top: 110px; left: 73px; }
#otp3 { top: 110px; left: 146px; }
#otp4 { top: 110px; left: 220px; }

/* DIAMOND POSITIONS (When verifying) */
.otp-diamond.verifying #otp1 { top: 10px; left: 110px; }
.otp-diamond.verifying #otp2 { top: 110px; left: 210px; }
.otp-diamond.verifying #otp3 { top: 210px; left: 110px; }
.otp-diamond.verifying #otp4 { top: 110px; left: 10px; }

.otp-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(41, 94, 138, 0.3);
    transform: scale(1.1);
}

.otp-input.has-value {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.btn-verify {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-verify:hover {
    background: var(--primary-dark);
    box-shadow: 0 0 15px rgba(41, 94, 138, 0.4);
}

/* SPARKS & GLOW ANIMATION DURING VERIFICATION */
.otp-diamond.verifying .otp-input {
    animation: verifyingPulse 0.4s alternate infinite;
    border-color: #0dfdcf;
    color: #0dfdcf;
    background: #000;
}

@keyframes verifyingPulse {
    0% {
        box-shadow: 0 0 10px #0dfdcf, 0 0 20px #0dfdcf;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 20px #0dfdcf, 0 0 40px #0dfdcf, 0 0 60px var(--primary-color), 0 0 80px var(--primary-color);
        transform: scale(1.15);
    }
}

.otp-diamond.verifying .otp-trace.active-trace {
    animation: draw 0.6s ease forwards, tracePulse 0.4s alternate infinite;
}

@keyframes tracePulse {
    0% { stroke: var(--primary-color); filter: drop-shadow(0 0 6px rgba(41, 94, 138, 0.8)); }
    100% { stroke: #0dfdcf; filter: drop-shadow(0 0 15px rgba(13, 253, 207, 1)); }
}


/* Mobile Tabs (hidden on desktop, shown via media query) */
.auth-mobile-tabs {
    display: none;
}

/* Responsiveness */
@media (max-width: 768px) {
    .auth-card { width: 100%; min-height: 650px; }

    /* Pestañas superiores */
    .auth-mobile-tabs {
        display: flex;
        position: relative;
        z-index: 210;
        width: 100%;
        background: #f1f5f9;
        border-bottom: 1px solid #e2e8f0;
    }
    .mobile-tab {
        flex: 1;
        padding: 14px 8px;
        background: transparent;
        border: none;
        color: #64748b;
        font-size: 13px;
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        cursor: pointer;
        transition: all 0.25s ease;
        border-bottom: 3px solid transparent;
    }
    .mobile-tab i { margin-right: 6px; }
    .mobile-tab.active {
        color: var(--primary-color);
        background: #ffffff;
        border-bottom-color: var(--primary-color);
    }

    /* Paneles */
    .auth-panel { width: 100%; padding: 40px 30px 0 30px; }
    .login-panel { z-index: 5; }
    .register-panel { z-index: 1; pointer-events: none; }
    .auth-overlay-container { display: none; }
    
    .auth-card.right-panel-active .login-panel { transform: translateX(0); opacity: 0; z-index: 1; pointer-events: none; }
    .auth-card.right-panel-active .register-panel { transform: translateX(0); opacity: 1; z-index: 5; pointer-events: all; }
}
