/* ============================================
   LOGIN PAGE - Mobile First
   Paleta: Verde claro, Azul metálico, Blanco
   ============================================ */

.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    background: #4ecdc4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
}

/* Patrón decorativo de fondo - Removido para colores planos */

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    min-height: calc(100vh - 40px);
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 20px;
    animation: fadeInDown 0.6s ease;
    flex-shrink: 0;
}

.logo-img {
    max-width: 200px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Form Container */
.login-form-container {
    background: white;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.login-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #2c3e50;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.login-title::before {
    content: '💳';
    font-size: 32px;
}

.login-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    text-align: center;
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.login-subtitle::before {
    content: '🔐';
    font-size: 16px;
}

/* Form */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-label::before {
    content: '🔑';
    font-size: 16px;
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 45px;
    font-size: 16px;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    background: #f8f9fa;
    color: #2c3e50;
    transition: all 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: #4ecdc4;
    background: white;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.1);
}

.form-control::placeholder {
    color: #95a5a6;
}

/* Icono de candado en el input */
.form-control[type="password"],
.form-control[type="text"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2395a5a6" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>');
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 20px 20px;
}

/* Toggle Password Button */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 38px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 20px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.btn-toggle-password:hover {
    color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
    transform: scale(1.1);
}

.btn-toggle-password:active {
    transform: scale(0.95);
}

.icon-eye {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Button */
.btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #2c3e50;
    color: white;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.btn-primary::before {
    content: '→';
    font-size: 20px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login {
    margin-top: 20px;
    min-height: 48px;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner */
.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); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert::before {
    font-size: 18px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 2px solid #fcc;
}

.alert-error::before {
    content: '⚠️';
}

/* Footer */
.login-footer {
    margin-top: 16px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #e8ecef;
}

.text-muted {
    font-size: 12px;
    color: #95a5a6;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.text-muted::before {
    content: '💰';
    font-size: 14px;
}

/* Tablet */
@media (min-width: 768px) {
    .login-container {
        max-width: 480px;
        padding: 30px;
    }
    
    .logo-img {
        max-width: 220px;
    }
    
    .login-form-container {
        padding: 32px 28px;
    }
    
    .login-title {
        font-size: 28px;
    }
    
    .login-title::before {
        font-size: 32px;
    }
    
    .login-logo {
        margin-bottom: 24px;
    }
}

/* Desktop (Secundario) */
@media (min-width: 1024px) {
    .login-container {
        max-width: 500px;
        padding: 40px;
    }
    
    .login-form-container {
        padding: 36px 32px;
    }
    
    .form-control {
        font-size: 16px; /* Evitar zoom en iOS */
    }
}

/* Pantallas muy pequeñas - Asegurar que todo sea visible */
@media (max-height: 700px) {
    .login-page {
        padding: 15px;
        align-items: flex-start;
        min-height: auto;
    }
    
    .login-container {
        min-height: auto;
        padding-top: 20px;
        padding-bottom: 20px;
        justify-content: flex-start;
    }
    
    .login-logo {
        margin-bottom: 15px;
        margin-top: 0;
    }
    
    .logo-img {
        max-width: 150px;
    }
    
    .login-form-container {
        padding: 20px 18px;
    }
    
    .login-title {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .login-title::before {
        font-size: 26px;
    }
    
    .login-subtitle {
        font-size: 12px;
        margin-bottom: 18px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-control {
        padding: 12px 14px 12px 40px;
    }
    
    .btn-login {
        margin-top: 16px;
        min-height: 44px;
        padding: 14px 20px;
    }
    
    .login-footer {
        margin-top: 12px;
        padding-top: 12px;
    }
}

/* Pantallas extra pequeñas */
@media (max-height: 500px) {
    .login-page {
        padding: 10px;
    }
    
    .login-container {
        padding: 15px 10px;
    }
    
    .login-logo {
        margin-bottom: 10px;
    }
    
    .logo-img {
        max-width: 120px;
    }
    
    .login-form-container {
        padding: 18px 16px;
    }
    
    .login-title {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .login-title::before {
        font-size: 24px;
    }
    
    .login-subtitle {
        font-size: 11px;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-control {
        padding: 11px 12px 11px 38px;
        font-size: 15px;
    }
    
    .btn-login {
        margin-top: 14px;
        min-height: 42px;
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .login-footer {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .text-muted {
        font-size: 11px;
    }
}
