/**
 * RTEC — Login iOS / macOS Glassmorphism
 */

.login-page {
    margin: 0; padding: 0;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #dce8ff 0%, #eef5ff 20%, #f5efff 50%, #edfff5 78%, #fffbea 100%);
    background-attachment: fixed;
    position: relative;
}

/* Orbes de luz de fondo (estilo iOS wallpaper) */
.login-page::before,
.login-page::after {
    content: '';
    position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
    filter: blur(80px); opacity: 0.55;
}
.login-page::before {
    width: 600px; height: 600px; top: -150px; left: -150px;
    background: radial-gradient(circle, rgba(120,180,255,0.6), rgba(160,100,255,0.3));
}
.login-page::after {
    width: 500px; height: 500px; bottom: -120px; right: -120px;
    background: radial-gradient(circle, rgba(80,220,180,0.5), rgba(100,180,255,0.3));
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%; max-width: 980px;
    background: rgba(255,255,255,0.68);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.7) inset;
    margin: 2rem;
    position: relative; z-index: 1;
}

/* ============================================
   LADO IZQUIERDO — BRANDING
   ============================================ */
.login-brand {
    background: linear-gradient(145deg, rgba(var(--primary-rgb),0.85) 0%, rgba(100,60,220,0.88) 100%);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    color: white;
    padding: 3rem;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute; top: -50%; right: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 65%);
    animation: pulse 12s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.08) rotate(5deg); }
}

.brand-content { position: relative; z-index: 1; text-align: center; }

.brand-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; margin-bottom: 2rem;
}
.brand-logo i {
    font-size: 3.5rem;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25));
}
.brand-logo h1 {
    font-size: 3rem; font-weight: 900;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.login-brand h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.login-brand p  { font-size: 1rem; opacity: 0.88; margin-bottom: 2.5rem; }

.brand-features {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 2rem;
}

.feature {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 1.1rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.feature:hover { background: rgba(255,255,255,0.2); transform: translateY(-4px); }
.feature i    { font-size: 1.75rem; }
.feature span { font-size: 0.85rem; text-align: center; font-weight: 600; opacity: 0.95; }

/* ============================================
   LADO DERECHO — FORMULARIO
   ============================================ */
.login-form-container {
    padding: 3rem;
    display: flex; flex-direction: column; justify-content: center;
    background: rgba(255,255,255,0.45);
}

.login-form { max-width: 380px; width: 100%; margin: 0 auto; }

.login-form h2 {
    font-size: 1.85rem; font-weight: 800;
    color: var(--gray-900); margin-bottom: 4px; letter-spacing: -0.4px;
}

.login-subtitle { color: var(--gray-500); margin-bottom: 2rem; font-size: 14px; }

.alert {
    padding: 12px 16px; border-radius: 14px;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
    font-size: 14px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: rgba(var(--danger-rgb),0.1);
    border: 1px solid rgba(var(--danger-rgb),0.25);
    color: var(--danger-dark);
}
.alert i { font-size: 16px; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: flex; align-items: center; gap: 6px;
    font-weight: 700; color: var(--gray-500);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%; padding: 12px 14px;
    background: rgba(255,255,255,0.7);
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 14px; font-size: 15px;
    font-family: -apple-system,'SF Pro Text','Inter',sans-serif;
    color: var(--gray-800);
    transition: all 0.2s;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.form-group input:focus {
    outline: none; background: rgba(255,255,255,0.92);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb),0.14);
}
.form-group input.error { border-color: var(--danger); }

.password-input { position: relative; }
.password-input input { padding-right: 3rem; }

.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--gray-400);
    cursor: pointer; padding: 6px; border-radius: 8px; transition: var(--transition);
}
.toggle-password:hover { color: var(--primary); background: rgba(var(--primary-rgb),0.08); }

.form-options {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--gray-600); cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: auto; cursor: pointer; }

.btn-primary {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; border-radius: 14px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 6px 20px rgba(var(--primary-rgb),0.4);
    font-family: inherit;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(var(--primary-rgb),0.5); }
.btn-primary:active { transform: scale(0.97); }

.login-help {
    margin-top: 1.5rem; padding: 14px 16px;
    background: rgba(var(--primary-rgb),0.05);
    border: 1px solid rgba(var(--primary-rgb),0.12);
    border-radius: 14px;
}
.login-help p {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; color: var(--gray-600); margin-bottom: 8px;
}
.login-help ul { list-style: none; padding: 0; margin: 0; }
.login-help li { padding: 4px 0; font-size: 13px; color: var(--gray-500); }
.login-help strong { color: var(--primary); font-weight: 700; }

.login-footer {
    text-align: center; padding: 1.25rem;
    color: var(--gray-400); font-size: 12px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .login-container { grid-template-columns: 1fr; max-width: 480px; }
    .login-brand { display: none; }
    .login-form-container { padding: 2.5rem; }
}

@media (max-width: 640px) {
    .login-page { padding: 1rem; }
    .login-container { margin: 0; border-radius: 20px; }
    .login-form-container { padding: 1.75rem; }
    .login-form h2 { font-size: 1.5rem; }
}

/* ============================================
   ANIMACIONES
   ============================================ */
.login-form { animation: fadeInUp 0.5s cubic-bezier(0.34,1.56,0.64,1); }

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

.brand-logo { animation: zoomIn 0.7s cubic-bezier(0.34,1.56,0.64,1); }

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.75); }
    to   { opacity: 1; transform: scale(1); }
}

.feature { animation: fadeIn 0.5s ease-out backwards; }
.feature:nth-child(1) { animation-delay: 0.15s; }
.feature:nth-child(2) { animation-delay: 0.25s; }
.feature:nth-child(3) { animation-delay: 0.35s; }
.feature:nth-child(4) { animation-delay: 0.45s; }

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