/* ===================================================================
   SISTEMA DE DISEÑO BASE - PLATAFORMA EDUCATIVA ICFES
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Paleta de Colores Primaria */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  --gradient-card: linear-gradient(145deg, #4338CA 0%, #312E81 100%);
  --gradient-accent: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);

  /* Neutros */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #0F172A;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* Estados */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #0EA5E9;
  --info-light: #E0F2FE;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-phone: 0 25px 50px -12px rgba(15, 23, 42, 0.35);

  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Tipografías */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===================================================================
   BARRA SUPERIOR GLOBAL & CONMUTADOR DE VISTAS (APP vs PANEL WEB)
   =================================================================== */

.top-navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.top-navbar-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Conmutador de vistas */
.view-switcher {
  display: flex;
  background: var(--border-light);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.switcher-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.switcher-btn:hover:not(.active) {
  color: var(--text-main);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--success-light);
  color: #065F46;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.api-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.docs-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.docs-link:hover {
  background: #E0E7FF;
}

/* ===================================================================
   CONTENEDOR PRINCIPAL
   =================================================================== */

.main-viewport {
  flex: 1;
  width: 100%;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid var(--primary);
  animation: slide-in-toast 0.3s ease forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

.toast-content h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.toast-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@keyframes slide-in-toast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===================================================================
   PORTAL DE AUTENTICACIÓN INSTITUCIONAL (LOGIN Y REGISTRO)
   =================================================================== */
.auth-portal-section {
  min-height: calc(100vh - 75px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(circle at 10% 20%, rgba(0, 51, 102, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
              var(--bg-app);
}

.auth-portal-container {
  max-width: 1040px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg-surface);
  border-radius: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 51, 102, 0.15), 0 0 0 1px rgba(0, 51, 102, 0.08);
  overflow: hidden;
}

@media (max-width: 880px) {
  .auth-portal-container {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .auth-portal-brand {
    display: none;
  }
}

.auth-portal-brand {
  background: linear-gradient(145deg, #001F3F 0%, #003366 50%, #082F49 100%);
  padding: 44px 38px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-portal-brand::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.auth-portal-form-wrapper {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
}

.auth-nav-tabs {
  display: flex;
  background: #F1F5F9;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 24px;
  gap: 6px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-tab-btn.active {
  background: white;
  color: #003366;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-input-group {
  margin-bottom: 16px;
}

.auth-input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 6px;
}

.auth-input-field-wrapper {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #94A3B8;
}

.auth-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #003366;
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}

.auth-submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #003366 0%, #002244 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 51, 102, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 51, 102, 0.45);
}

.auth-alert-box {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
}

.auth-alert-box.show {
  display: flex !important;
}

.auth-alert-box.error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

.auth-alert-box.success {
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
  color: #065F46;
}

