/**
 * SISE - Estilos de Login
 * Desarrollado por Luis Rivas
 * Licencia de uso: Colegio Español Padre Arrupe 2026
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0284c7 0%, #0c4a6e 100%);
    padding: 20px;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    padding: 35px 30px;
    text-align: center;
    color: white;
}

.login-logo {
    width: 80px; height: 80px;
    background: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 15px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.login-logo img { max-width: 100%; max-height: 100%; }

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.login-header p { font-size: 0.9rem; opacity: 0.9; }
.login-header .institution { font-size: 0.8rem; margin-top: 8px; opacity: 0.85; }

.login-body { padding: 35px 30px; }

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert i { font-size: 1.2rem; }

.form-group { margin-bottom: 20px; }

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
}

.form-label i { color: #0ea5e9; }

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #0ea5e9;
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 50px; }

.password-toggle {
    position: absolute;
    right: 0; top: 0;
    height: 100%; width: 50px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover { color: #0ea5e9; }

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    color: white;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    transition: all 0.2s;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.login-footer {
    padding: 20px 30px;
    background: #f8fafc;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.login-footer img { height: 50px; margin-bottom: 10px; }
.login-footer .copyright { color: #64748b; font-size: 0.75rem; margin: 5px 0 0 0; }
.login-footer .developer { color: #94a3b8; font-size: 0.7rem; margin-top: 8px; }

.spinner {
    width: 20px; height: 20px;
    border: 2px 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); } }

/* Estilos para Debug Panel */
.debug-panel {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
}

.debug-header {
    background: #0f172a;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #334155;
}

.debug-header i { color: #fbbf24; font-size: 1.1rem; }
.debug-header span { font-weight: 600; color: #fbbf24; }

.debug-body { padding: 15px; }

.debug-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #334155;
}

.debug-section:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.debug-label {
    color: #22d3ee;
    font-weight: 600;
    margin-bottom: 5px;
}

.debug-value { color: #a5f3fc; word-break: break-all; }
.debug-value.success { color: #4ade80; }
.debug-value.error { color: #f87171; }

.debug-json {
    background: #0f172a;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.debug-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 10px;
}

.debug-badge.active { background: #22c55e; color: white; }
