/* ==========================================
   Modal de Autenticación - Wacheck
   ========================================== */

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
    animation: fadeIn 0.3s;
}

.auth-modal-content {
    background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(8, 145, 178, 0.25);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 450px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin: auto;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    animation: slideUp 0.4s;
    box-sizing: border-box;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
    padding: 5px 10px;
}

.auth-modal-close:hover {
    color: #ef4444;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.auth-tab.active {
    color: #38bdf8;
    border-bottom-color: #0891b2;
}

.auth-tab:hover {
    color: #38bdf8;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 5px;
    font-family: var(--font-display, 'Orbitron', sans-serif);
    letter-spacing: 0.02em;
}

.auth-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 15px;
}

.auth-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 15px;
    color: #e2e8f0;
    transition: all 0.3s;
    font-family: var(--font-body, 'Inter', sans-serif);
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: #475569;
}

.auth-input:focus {
    outline: none;
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.08);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

/* Password field con toggle (ojito) */
.password-field {
    position: relative;
    width: 100%;
}

.password-field .auth-input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #0891b2;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(8, 145, 178, 0.3);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 10px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 15px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.auth-button-guest {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: 2px solid #94a3b8;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-button-guest:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(100, 116, 139, 0.4);
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.auth-button-guest:active {
    transform: translateY(0);
}

.auth-button-guest .guest-icon {
    font-size: 20px;
}

.auth-message {
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    min-height: 20px;
    font-weight: 500;
    white-space: pre-line;
}

.auth-info {
    background: rgba(8, 145, 178, 0.12);
    border: 1px solid rgba(8, 145, 178, 0.3);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #7dd3fc;
    text-align: center;
}

/* Password strength indicator */
.password-strength {
    margin-top: -8px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

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

.strength-weak   { background: #ef4444; }
.strength-fair   { background: #f59e0b; }
.strength-good   { background: #10b981; }
.strength-strong { background: #0891b2; }

.password-strength-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-align: right;
}

/* Google OAuth button */
.auth-button-google {
    width: 100%;
    padding: 13px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.auth-button-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.auth-button-google svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(50px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@media (max-width: 768px) {
    .auth-modal {
        padding: 12px 8px;
        align-items: flex-start;
    }

    .auth-modal-content {
        padding: 24px 16px;
        max-width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }
    
    .auth-title {
        font-size: 22px;
    }

    .auth-form {
        gap: 12px;
    }

    .auth-button,
    .auth-button-guest,
    .auth-button-google {
        padding: 12px;
        font-size: 14px;
    }
}

/* ==========================================
   Light Theme Overrides
   ========================================== */
body.light-theme .auth-modal {
    background: rgba(0, 0, 0, 0.45);
}

body.light-theme .auth-modal-content {
    background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
    border-color: rgba(8, 145, 178, 0.18);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

body.light-theme .auth-modal-close {
    color: #64748b;
}

body.light-theme .auth-modal-close:hover {
    color: #ef4444;
}

body.light-theme .auth-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .auth-tab {
    color: #94a3b8;
}

body.light-theme .auth-tab.active {
    color: #0891b2;
    border-bottom-color: #0891b2;
}

body.light-theme .auth-tab:hover {
    color: #0891b2;
}

body.light-theme .auth-title {
    color: #0f172a;
}

body.light-theme .auth-subtitle {
    color: #64748b;
}

body.light-theme .auth-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

body.light-theme .auth-input::placeholder {
    color: #94a3b8;
}

body.light-theme .auth-input:focus {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.04);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

body.light-theme .form-field label {
    color: #334155;
}

body.light-theme .password-toggle {
    color: #94a3b8;
}

body.light-theme .password-toggle:hover {
    color: #0891b2;
}

body.light-theme .auth-divider::before,
body.light-theme .auth-divider::after {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .auth-divider span {
    color: #94a3b8;
}

body.light-theme .auth-button-google {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: #334155;
}

body.light-theme .auth-button-google:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.18);
}

body.light-theme .auth-button-guest {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.light-theme .auth-button-guest:hover {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    color: #1e293b;
}

body.light-theme .auth-info {
    background: rgba(8, 145, 178, 0.06);
    border-color: rgba(8, 145, 178, 0.15);
    color: #0e7490;
}

body.light-theme .auth-msg {
    color: #64748b;
}

body.light-theme .password-strength-label {
    color: #94a3b8;
}
