/*login.css*/
/* Reset y configuración base Android */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: block; /* Cambiado de flex */
    /* Removidos: align-items, justify-content, padding */
    position: relative;
}

/* Card Container - Estilo Material */
.login-container {
    background: transparent; /* Cambiado de white */
    border-radius: 0; /* Cambiado de 16px */
    box-shadow: none; /* Removida la sombra */
    overflow: visible; /* Cambiado de hidden */
    /* animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); */ /* Opcional: mantener o quitar */
    max-width: none; /* Cambiado de 400px */
    width: 100%;
    min-height: 100vh; /* Agregado para ocupar toda la pantalla */
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(40px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Header de la Card */
.card-header {
    padding: 32px 24px 24px;
    text-align: center;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    position: relative;
}

.logo-container {
    margin-bottom: 16px;
}

.logo-placeholder {
    width: 64px;
    height: 64px;
    background: #ffffff;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    padding: 4px;
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.logo-text {
    color: white;
    font-weight: 500;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

/* Títulos Material Design */
.app-title {
    color: white;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 4px;
    letter-spacing: 0.15px;
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
}

/* Card Body */
.form-container {
    padding: 32px 24px;
    background: white; /* Agregado fondo blanco */
    flex: 1; /* Para que ocupe el espacio restante */
    min-height: calc(100vh - 200px); /* Ajustar según el header */
}

/* Alertas Material */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    font-weight: 400;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-icon {
    font-size: 16px;
    width: 16px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Formulario Material Design */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    position: relative;
}

/* Material Input Fields */
.input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.input-container:focus-within {
    background: white;
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.12);
    elevation: 2;
}

.input-icon {
    position: absolute;
    left: 16px;
    z-index: 2;
    color: #757575;
    transition: color 0.2s ease;
    width: 20px;
    text-align: center;
}

.input-container:focus-within .input-icon {
    color: #1976d2;
}

.input-container input {
    width: 100%;
    padding: 16px 54px 16px 52px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #212121;
    font-weight: 400;
    outline: none;
    font-family: inherit;
}

.input-container input::placeholder {
    color: #9e9e9e;
    font-weight: 400;
}

.toggle-password {
    position: absolute;
    right: 16px;
    cursor: pointer;
    color: #757575;
    z-index: 2;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    background: rgba(25, 118, 210, 0.08);
    color: #1976d2;
}

.toggle-password:active {
    transform: scale(0.95);
    background: rgba(25, 118, 210, 0.16);
}

/* Material Checkbox */
.checkbox-container {
    margin: 4px 0 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    padding: 8px 4px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(0, 0, 0, 0.04);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #9e9e9e;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    background: transparent;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #1976d2;
    border-color: #1976d2;
    transform: scale(1.1);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: #424242;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.25px;
}

/* Material Button */
.login-btn {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    min-height: 48px;
    elevation: 2;
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

.login-btn:hover {
    elevation: 4;
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
    transform: translateY(-1px);
}

.login-btn:active {
    elevation: 8;
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Material Ripple Effect */
.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s, top 0.6s, left 0.6s;
    transform: translate(-50%, -50%);
}

.login-btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer Links Material */
.footer-links {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
}

.link {
    color: #1976d2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    letter-spacing: 0.25px;
}

.link:hover {
    background: rgba(25, 118, 210, 0.08);
}

.link:active {
    background: rgba(25, 118, 210, 0.16);
}
/* Copyright Footer - Discreto y centrado */
.copyright-footer {
    text-align: center;
    padding: 16px 0 8px 0;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.38);
    font-weight: 400;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.copyright-footer:hover {
    color: rgba(0, 0, 0, 0.54);
}

/* Ajuste para dark mode si lo tienes */
@media (prefers-color-scheme: dark) {
    .copyright-footer {
        color: rgba(255, 255, 255, 0.38);
        border-top-color: rgba(255, 255, 255, 0.06);
    }
    
    .copyright-footer:hover {
        color: rgba(255, 255, 255, 0.54);
    }
}

/* Responsivo Android */
@media (max-width: 480px) {

    .app-container {
        /* padding: 16px 12px; */ /* Removido */
    }
    .main-content {
        padding: 16px 12px;
    }
    
     .login-container {
        border-radius: 0; /* Ya estaba correcto */
        margin: 0;
        min-height: 100vh; /* Cambiado de calc(100vh - 80px) */
    }
    
    .card-header {
        padding: 40px 24px 32px; /* Aumentado el padding superior */
    }
    
    .form-container {
        padding: 24px 20px;
        flex: 1; /* Agregado */
    }
    
    .app-title {
        font-size: 22px;
    }
    
    .input-container input {
        font-size: 16px;
    }
}

/* Dark Mode Android - CORREGIDO */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0d47a1 0%, #01579b 100%);
    }
    
    .app-container {
        background: linear-gradient(135deg, #0d47a1 0%, #01579b 100%);
    }
    
    .login-container {
        background: transparent;
        color: white;
    }
    
    /* Header se mantiene igual ya que siempre es azul */
    .card-header {
        background: linear-gradient(135deg, #1976d2, #1565c0);
    }
    
    .app-title, .app-subtitle {
        color: white;
    }
    
    /* Form Container - CORREGIDO */
    .form-container {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    /* Input containers - MEJORADO */
    .input-container {
        background: #2a2a2a;
        border-color: transparent;
    }
    
    .input-container:focus-within {
        background: #333333;
        border-color: #1976d2;
        box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
    }
    
    /* Input icons - CORREGIDO */
    .input-icon {
        color: #9e9e9e;
    }
    
    .input-container:focus-within .input-icon {
        color: #42a5f5;
    }
    
    /* Toggle password - CORREGIDO */
    .toggle-password {
        color: #9e9e9e;
    }
    
    .toggle-password:hover {
        background: rgba(66, 165, 245, 0.1);
        color: #42a5f5;
    }
    
    .toggle-password:active {
        background: rgba(66, 165, 245, 0.2);
    }
    
    /* Input text - CORREGIDO */
    .input-container input {
        color: #e0e0e0;
    }
    
    .input-container input::placeholder {
        color: #757575;
    }
    
    /* Checkbox - CORREGIDO */
    .checkbox-text {
        color: #e0e0e0;
    }
    
    .checkbox-label:hover {
        background: rgba(255, 255, 255, 0.08);
    }
    
    .checkmark {
        border-color: #757575;
        background: transparent;
    }
    
    .checkbox-label input[type="checkbox"]:checked + .checkmark {
        background: #1976d2;
        border-color: #1976d2;
    }
    
    /* Alertas - MEJORADO */
    .alert-error {
        background: #2d1b1b;
        color: #ff5252;
        border-left-color: #f44336;
    }
    
    .alert-success {
        background: #1b2d1b;
        color: #4caf50;
        border-left-color: #4caf50;
    }
    
    /* Footer links - CORREGIDO */
    .link {
        color: #42a5f5;
    }
    
    .link:hover {
        background: rgba(66, 165, 245, 0.1);
    }
    
    .link:active {
        background: rgba(66, 165, 245, 0.2);
    }
    
    /* Botón - se mantiene igual ya que funciona bien en dark mode */
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    .card-header {
        padding: 16px 24px;
    }
    
    .logo-placeholder {
        width: 48px;
        height: 48px;
        padding: 3px;
    }
    
    .app-title {
        font-size: 20px;
    }
    
    .form-container {
        padding: 16px 24px;
    }
    
    .login-form {
        gap: 16px;
    }
}

/* Agregar estos estilos al archivo login.css existente */

/* Password Requirements */
.password-requirements {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(25, 118, 210, 0.1);
}

.requirements-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1976d2;
    margin: 0 0 12px 0;
}

.requirements-title i {
    font-size: 14px;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirements-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #666;
    padding: 6px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.requirements-list li i {
    font-size: 10px;
    color: #ccc;
    transition: all 0.3s ease;
}

.requirements-list li.valid {
    color: #4caf50;
    font-weight: 500;
}

.requirements-list li.valid i {
    color: #4caf50;
    font-size: 14px;
}

/* Animación de check */
@keyframes checkPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.requirements-list li.valid i {
    animation: checkPulse 0.3s ease;
}

/* Alert styles mejorados */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideInDown 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #81c784;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .password-requirements {
        padding: 14px;
    }
    
    .requirements-title {
        font-size: 12px;
    }
    
    .requirements-list li {
        font-size: 12px;
        padding: 5px 0;
    }
}

/* ========================================
   FIX: Toggle Password Button
   ======================================== */

.toggle-password {
    position: absolute;
    right: 16px;
    cursor: pointer;
    color: #757575;
    z-index: 2;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    outline: none;
}

.toggle-password:hover {
    background: rgba(25, 118, 210, 0.08);
    color: #1976d2;
}

.toggle-password:active {
    transform: scale(0.95);
    background: rgba(25, 118, 210, 0.16);
}

.toggle-password i {
    font-size: 18px;
    pointer-events: none;
}

/* ========================================
   FIX: Password Requirements Dark Mode
   ======================================== */

@media (prefers-color-scheme: dark) {
    .password-requirements {
        background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
        border: 1px solid rgba(66, 165, 245, 0.2);
    }
    
    .requirements-title {
        color: #42a5f5;
    }
    
    .requirements-list li {
        color: #b0b0b0;
    }
    
    .requirements-list li i {
        color: #666666;
    }
    
    .requirements-list li.valid {
        color: #4caf50;
    }
    
    .requirements-list li.valid i {
        color: #4caf50;
    }
    
    /* Toggle password en dark mode */
    .toggle-password {
        color: #9e9e9e;
    }
    
    .toggle-password:hover {
        background: rgba(66, 165, 245, 0.1);
        color: #42a5f5;
    }
    
    .toggle-password:active {
        background: rgba(66, 165, 245, 0.2);
    }
}

/* ========================================
   Responsive ajustado
   ======================================== */

@media (max-width: 480px) {
    .toggle-password {
        right: 12px;
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .toggle-password i {
        font-size: 16px;
    }
}