/* ========================================== */
/* CONFIGURACIÓN GLOBAL                       */
/* ========================================== */
.auth-container {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--brand-gray-100, #FAFAF8);
}

.mobile-tab-switcher {
    display: none; 
}

.auth-card {
    position: relative;
    width: 1000px;
    max-width: 100%;
    min-height: 650px;
    background: #ffffff;
    border-radius: 6px 24px 6px 24px;
    box-shadow: 0 15px 35px rgba(20,20,20,0.08);
    perspective: 1500px;
    overflow: hidden;
}

/* ========================================== */
/* INPUTS CON ETIQUETAS FLOTANTES             */
/* ========================================== */
.form-group {
    position: relative;
    margin-bottom: 22px; 
}

.form-control {
    width: 100%;
    padding: 16px 15px; 
    font-size: 15px;
    border: 2px solid var(--brand-gray-200, #E6E4DF);
    border-radius: var(--brand-radius-chip, 3px 12px 3px 12px);
    background-color: transparent;
    color: var(--brand-primary, #141414);
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--brand-primary, #141414);
}

.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
    top: 0; 
    font-size: 13px;
    color: var(--brand-primary, #141414);
    font-weight: 600;
}

.floating-label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--brand-text-lighter, #77746D);
    pointer-events: none;
    transition: all 0.3s ease;
    background-color: #ffffff;
    padding: 0 5px;
    margin: 0;
    border-radius: 3px;
}

/* ========================================== */
/* CONTRASEÑAS (BOTÓN DE CANDADO)             */
/* ========================================== */
.password-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%); 
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--brand-text-lighter, #77746D);
    z-index: 2;
}

/* ========================================== */
/* FUERZA DE CONTRASEÑA                      */
/* ========================================== */
.password-strength-container {
    margin-top: -10px;
    margin-bottom: 15px;
}

.strength-bar {
    height: 4px;
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 2px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 12px;
    display: block;
    text-align: right;
    margin-top: 4px;
}

.strength-weak {
    background-color: var(--ui-danger, #B3261E);
    width: 33%;
}

.strength-medium {
    background-color: var(--ui-warning, #8A6100);
    width: 66%;
}

.strength-strong {
    background-color: var(--ui-success, #2E7D4F);
    width: 100%;
}

/* ========================================== */
/* REQUISITOS DE CONTRASEÑA (1 COLUMNA)      */
/* ========================================== */
.password-requirements {
    background: var(--brand-gray-100, #FAFAF8);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px 0 16px 0;
    display: grid;
    grid-template-columns: 1fr; /* 🔥 UNA SOLA COLUMNA */
    gap: 2px 0;
}

.req-item {
    transition: all 0.3s ease;
    padding: 3px 0;
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: normal;
}

.req-item.valid {
    color: var(--ui-success, #2E7D4F) !important;
}

.req-item.invalid {
    color: var(--ui-danger, #B3261E) !important;
}

.req-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--brand-gray-300, #D3D0C8);
    border-radius: 3px 6px 3px 6px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.valid .req-icon { border-color: var(--ui-success, #2E7D4F); color: var(--ui-success, #2E7D4F); }
.invalid .req-icon { border-color: var(--ui-danger, #B3261E); color: var(--ui-danger, #B3261E); }
.req-icon svg { width: 11px; height: 11px; }

/* Responsive para móviles */
@media (max-width: 600px) {
    .password-requirements {
        padding: 8px 12px;
    }
    
    .req-item {
        font-size: 12px;
        padding: 2px 0;
    }
}

@media (max-width: 480px) {
    .password-requirements {
        padding: 6px 10px;
    }
    
    .req-item {
        font-size: 11px;
        padding: 2px 0;
        gap: 4px;
    }
    
    .req-icon {
        width: 16px;
        font-size: 12px;
    }
}

/* ========================================== */
/* DIVISOR "o" CENTRADO                       */
/* ========================================== */
.auth-divider {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin: 20px 0 15px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    flex-shrink: 0;
    padding: 0 10px;
    color: #999;
    font-size: 14px;
    text-transform: lowercase;
}

/* ========================================== */
/* BOTÓN GOOGLE                              */
/* ========================================== */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
    background: white;
    width: 100%;
    margin: 5px 0;
}

.btn-google:hover {
    background: var(--brand-gray-100, #FAFAF8);
    border-color: var(--brand-primary, #141414);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* ========================================== */
/* OTP RESPONSIVE                             */
/* ========================================== */
.otp-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-text-light, #5E5C57);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.otp-container {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.otp-input {
    width: 48px;
    height: 52px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    border: 2px solid var(--brand-gray-200, #E6E4DF);
    border-radius: var(--brand-radius-chip, 3px 12px 3px 12px);
    background-color: var(--brand-gray-100, #FAFAF8);
    color: var(--brand-primary, #141414);
    transition: all 0.2s ease-in-out;
    flex-shrink: 1;
    min-width: 30px;
}

.otp-input:focus {
    outline: none;
    border-color: var(--brand-primary, #141414);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.12);
    transform: translateY(-1px);
}

.otp-container.verified .otp-input {
    border-color: var(--ui-success, #2E7D4F);
    background-color: rgba(46, 125, 79, 0.06);
    color: var(--ui-success, #2E7D4F);
}

.otp-container.error-shake {
    animation: shake 0.4s ease-in-out;
}

.otp-container.error-shake .otp-input {
    border-color: var(--ui-danger, #B3261E);
    background-color: rgba(179, 38, 30, 0.05);
    color: var(--ui-danger, #B3261E);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Responsive OTP */
@media (max-width: 768px) {
    .otp-container {
        gap: 3px;
    }
    
    .otp-input {
        width: 40px;
        height: 45px;
        font-size: 18px;
        min-width: 28px;
    }
}

@media (max-width: 480px) {
    .otp-container {
        gap: 2px;
    }
    
    .otp-input {
        width: 32px;
        height: 38px;
        font-size: 14px;
        min-width: 22px;
        border-radius: 6px;
    }
}

@media (max-width: 380px) {
    .otp-container {
        gap: 2px;
    }
    
    .otp-input {
        width: 26px;
        height: 32px;
        font-size: 12px;
        min-width: 18px;
        border-radius: 4px;
        padding: 0 2px;
    }
}

/* ========================================== */
/* BOTÓN SUBMIT                              */
/* ========================================== */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--brand-accent, #F2B705);
    color: var(--brand-on-accent, #141414);
    border: none;
    border-radius: var(--brand-radius-btn, 4px 14px 4px 14px);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    background: var(--brand-accent-hover, #DCA500);
    box-shadow: 0 5px 15px rgba(242, 183, 5, 0.3);
}

/* ========================================== */
/* ALERTAS DE ERROR                          */
/* ========================================== */
.auth-alert.error {
    background: var(--brand-state-rechazada-bg, #F9E3E1);
    color: var(--ui-danger, #B3261E);
    border: 1px solid #F1C9C4;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ========================================== */
/* FORMULARIOS CON SCROLL                     */
/* ========================================== */
.form-container {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #fff;
    transition: all 0.6s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.form-container::-webkit-scrollbar {
    width: 6px;
}

.form-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.form-container::-webkit-scrollbar-thumb {
    background: var(--brand-gray-300, #D3D0C8);
    border-radius: 10px;
}

.form-container::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary, #141414);
}

.form-productor { left: 0; }
.form-proveedor { right: 0; }

/* ========================================== */
/* OVERLAYS ANIMADOS                          */
/* ========================================== */
.auth-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    background: var(--brand-primary, #141414);
    color: #ffffff;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-card.show-proveedor .auth-overlay { animation: turn-left 860ms linear forwards; }
.auth-card.show-productor .auth-overlay { animation: turn-right 860ms linear forwards; }

@keyframes turn-left {
    0%   { transform: translate3d(0, 0, 0) rotateY(0); }
    20%  { transform: translate3d(-10%, 0, 0) rotateY(-2.6deg); }
    40%  { transform: translate3d(-30%, 0, 0) rotateY(-4.5deg); }
    80%  { transform: translate3d(-90%, 0, 0) rotateY(-2.6deg); }
    100% { transform: translate3d(-100%, 0, 0) rotateY(0); }
}

@keyframes turn-right {
    0%   { transform: translate3d(-100%, 0, 0) rotateY(0); }
    20%  { transform: translate3d(-90%, 0, 0) rotateY(2.6deg); }
    40%  { transform: translate3d(-70%, 0, 0) rotateY(4.5deg); }
    80%  { transform: translate3d(-10%, 0, 0) rotateY(2.6deg); }
    100% { transform: translate3d(0, 0, 0) rotateY(0); }
}

.overlay-content {
    position: absolute;
    width: 100%;
    padding: 0 40px;
    text-align: center;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.overlay-productor { opacity: 1; transform: translateX(0); pointer-events: auto; }
.overlay-proveedor { opacity: 0; transform: translateX(20%); pointer-events: none; }

.auth-card.show-proveedor .overlay-productor { opacity: 0; transform: translateX(-20%); pointer-events: none; }
.auth-card.show-proveedor .overlay-proveedor { opacity: 1; transform: translateX(0); pointer-events: auto; }

.btn-ghost {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 10px 30px;
    border-radius: var(--brand-radius-btn, 4px 14px 4px 14px);
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-ghost:hover { background: #fff; color: var(--brand-primary, #141414); }

/* ========================================== */
/* RESPONSIVE MÓVIL                           */
/* ========================================== */
@media (max-width: 768px) {
    .mobile-tab-switcher {
        display: flex;
        width: 100%;
        max-width: 450px;
        background: #eee;
        border-radius: 8px;
        margin-bottom: 20px;
        overflow: hidden;
        border: 1px solid #ddd;
    }
    
    .tab-btn {
        flex: 1;
        padding: 12px;
        border: none;
        background: transparent;
        cursor: pointer;
        font-weight: bold;
        color: #555;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    
    .tab-btn.active {
        background: var(--brand-primary, #141414);
        color: white;
    }
    
    .auth-card {
        width: 100%;
        max-width: 450px;
        min-height: auto;
        max-height: 90vh;
        perspective: none;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        overflow-y: auto;
    }
    
    .auth-overlay { display: none; }
    
    .form-container {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 80vh;
        padding: 30px 20px;
        transition: none;
        overflow-y: auto;
        justify-content: flex-start;
    }
    
    .auth-card .form-productor { display: flex; }
    .auth-card .form-proveedor { display: none; }
    .auth-card.show-proveedor .form-productor { display: none; }
    .auth-card.show-proveedor .form-proveedor { display: flex; }
}

@media (max-width: 480px) {
    .form-container {
        padding: 20px 15px;
        max-height: 75vh;
    }
}