/* ============================================
   NEXUSFARMA BETA - AUTH STYLES (PREMIUM FINAL)
   ============================================ */

/* Variables premium */
:root {
    --auth-card-dark: rgba(20, 20, 35, 0.92);
    --auth-card-glow: rgba(118, 75, 162, 0.15);
    --auth-input-bg: rgba(255, 255, 255, 0.1);
    --auth-input-border: rgba(255, 255, 255, 0.25);
    --auth-input-focus: rgba(255, 255, 255, 0.4);
    --auth-shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.5);
    
    /* Colores corporativos */
    --primary-purple: #764ba2;
    --primary-blue: #667eea;
    --accent-pink: #f093fb;
    --text-light: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Body */
.auth-body {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
    font-family: 'Inter', sans-serif;
}

/* Background animado + OVERLAY OSCURO */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 50%, var(--accent-pink) 100%);
    background-size: 400% 400%;
    z-index: -1;
    animation: gradientShift 20s ease infinite;
}

/* OVERLAY OSCURO PARA CONTRASTE */
.auth-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: brightness(0.8);
}

/* Efectos de luz sutiles */
.auth-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: floatLight 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatLight {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(-20px); }
}

/* Contenedor principal - TAMAÑO OPTIMIZADO */
.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.auth-container-small {
    max-width: 420px;
}

/* Header - TAMAÑO MEJORADO */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.65rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.5);
}

.auth-logo:hover {
    transform: scale(1.08) translateY(-3px);
    text-shadow: 0 5px 25px rgba(255, 255, 255, 0.3);
}

.auth-logo .logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.4));
}

.auth-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
}

/* Card PREMIUM - SIN LÍNEA SUPERIOR */
.auth-card {
    background: var(--auth-card-dark);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 28px;
    box-shadow: var(--auth-shadow-lg),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset,
                0 0 80px var(--auth-card-glow);
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    max-height: none;
    overflow: visible;
}

/* Efecto de brillo sutil en los bordes */
.auth-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.3) 0%, 
        rgba(118, 75, 162, 0.3) 50%, 
        rgba(240, 147, 251, 0.3) 100%);
    border-radius: 28px;
    z-index: -1;
    opacity: 0.5;
    filter: blur(20px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Formularios - TAMAÑO MEJORADO */
.form-group {
    margin-bottom: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.2px;
}

.label-icon {
    font-size: 1.05rem;
    opacity: 0.95;
}

/* Inputs PREMIUM - TAMAÑO MEJORADO */
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--auth-input-border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: var(--auth-input-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    color: white;
    font-weight: 500;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    outline: none;
    border-color: var(--auth-input-focus);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.25),
                inset 0 2px 6px rgba(0, 0, 0, 0.2),
                0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.form-control.error {
    border-color: rgba(239, 68, 68, 0.8);
    background: rgba(239, 68, 68, 0.15);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Password input */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 3.2rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.45rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Errores */
.form-error {
    display: block;
    color: rgba(255, 255, 255, 0.98);
    background: rgba(239, 68, 68, 0.25);
    backdrop-filter: blur(12px);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border-left: 3px solid rgba(239, 68, 68, 0.9);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.form-error:empty {
    display: none;
}

.form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.3rem;
    font-style: italic;
}

/* Password strength */
.password-strength {
    margin-top: 0.6rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    box-shadow: 0 0 12px currentColor;
}

.strength-fill.weak { width: 25%; background: linear-gradient(90deg, #EF4444, #F87171); }
.strength-fill.medium { width: 50%; background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.strength-fill.good { width: 75%; background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.strength-fill.strong { width: 100%; background: linear-gradient(90deg, #10B981, #34D399); }

.strength-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Password requirements */
.password-requirements {
    margin-top: 0.65rem;
    padding: 0.65rem;
    background: rgba(102, 126, 234, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    border: 1.5px solid rgba(102, 126, 234, 0.25);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.requirements-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.4rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.req-icon {
    font-weight: bold;
    font-size: 0.85rem;
}

.req-item.valid {
    color: #10B981;
    background: rgba(16, 185, 129, 0.15);
}

.req-item.valid .req-icon::before {
    content: '✓';
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-light);
}

.checkbox-label input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    accent-color: var(--primary-purple);
}

.checkbox-label span {
    font-size: 0.88rem;
}

.checkbox-label a {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 700;
}

.checkbox-label a:hover {
    text-decoration: underline;
    color: white;
}

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.forgot-link {
    color: var(--accent-pink);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: white;
    text-decoration: underline;
}

/* Botón PREMIUM ULTRA */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    background-size: 200% 200%;
    color: white;
    font-weight: 800;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.5),
                0 0 40px rgba(118, 75, 162, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(118, 75, 162, 0.7),
                0 0 60px rgba(118, 75, 162, 0.5);
    background-position: 100% 0;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-2px);
}

/* Botón loading */
.btn-loading {
    position: relative;
}

.btn-loading.loading .btn-text {
    opacity: 0;
}

.btn-loading.loading .btn-loader {
    display: flex !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.1rem 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.2);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 800;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: white;
    text-decoration: underline;
}

/* Back home */
.back-home {
    text-align: center;
    margin-top: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
    padding: 0.65rem 1.3rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Demo credentials */
.demo-credentials {
    margin-top: 1rem;
    padding: 0.85rem;
    text-align: center;
    background: rgba(251, 191, 36, 0.18);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(251, 191, 36, 0.35);
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.demo-credentials p {
    margin: 0.3rem 0;
    color: rgba(255, 255, 255, 0.98);
    font-size: 0.8rem;
    font-weight: 600;
}

.demo-credentials code {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: white;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

/* Sección de formulario */
.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title:first-of-type {
    margin-top: 0;
}

/* Estilo para select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Form hint */
.form-hint {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    font-style: italic;
}

/* Input readonly */
input[readonly] {
    background-color: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
}


/* ============================================
   SCROLLBAR PREMIUM EN PÁGINA
   ============================================ */

/* Scrollbar personalizado para la página */
body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--primary-purple));
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(118, 75, 162, 0.6);
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-purple), var(--accent-pink));
    box-shadow: 0 0 15px rgba(118, 75, 162, 0.9);
}

/* Para Firefox */
body {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-body {
        padding: 1.5rem 0.75rem;
    }
    
    .auth-card {
        padding: 1.65rem;
    }
    
    .auth-title {
        font-size: 1.65rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-options {
        flex-direction: column;
        gap: 0.65rem;
        align-items: flex-start;
    }
    
    .password-requirements ul {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 750px) {
    .auth-header {
        margin-bottom: 1.1rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .password-requirements {
        margin-top: 0.5rem;
        padding: 0.5rem;
    }
}

/* ============================================
   FIX PARA SELECT - MEJORAR VISIBILIDAD
   ============================================ */
/* ============================================
   SELECT DROPDOWN - CORREGIDO PARA VISIBILIDAD
   ============================================ */

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 14px;
    padding-right: 45px;
    color: white;
    cursor: pointer;
    font-weight: 500;
}

/* ✅ OPCIONES DEL SELECT CON FONDO OSCURO Y TEXTO BLANCO */
select.form-control option {
    background-color: #1a1a2e !important;
    color: white !important;
    padding: 12px;
    font-weight: 500;
    border: none;
}

/* Opción por defecto (placeholder) */
select.form-control option[value=""] {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Hover en opciones */
select.form-control option:hover {
    background-color: #764ba2 !important;
    color: white !important;
}

/* Select cuando está abierto */
select.form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
}

/* SELECT sin valor seleccionado (placeholder) */
select.form-control:invalid {
    color: rgba(255, 255, 255, 0.5);
}

/* SELECT con valor seleccionado */
select.form-control:valid {
    color: white;
}

/* ✅ ALTERNATIVA: Estilos nativos del navegador */
select.form-control option:checked {
    background-color: #764ba2 !important;
    color: white !important;
}