:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --pucp-blue: #042354;
  --accent: #f59e0b;
  --bg-dark: #090d16;
  --card-bg: rgba(17, 24, 39, 0.84);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --whatsapp: #25D366;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  min-height: 100vh;
  color: var(--text-main);
  background-color: var(--bg-dark);
  background-image: 
    linear-gradient(135deg, rgba(9, 13, 22, 0.88) 0%, rgba(15, 23, 42, 0.84) 50%, rgba(4, 35, 84, 0.88) 100%),
    url('https://images.unsplash.com/photo-1513635269975-59663e0ac1ad?auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

.english-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.04;
  font-weight: 800;
  font-size: 5rem;
  line-height: 1.4;
  user-select: none;
  transform: rotate(-8deg) scale(1.1);
}

/* PANTALLA DE LOGIN */
#login-screen {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 44px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

.badge-english {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #0f172a;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.3);
}

/* PANEL PRINCIPAL */
#app-screen {
  position: relative;
  z-index: 1;
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

header.navbar {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-glass);
  padding: 16px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #042354);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  border: 1px solid rgba(255,255,255,0.2);
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* CONTENEDOR Y PESTAÑAS */
main.container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 100px;
  flex: 1;
}

.tabs-bar {
  display: flex;
  gap: 12px;
  background: rgba(15, 23, 42, 0.75);
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  margin-bottom: 30px;
  backdrop-filter: blur(12px);
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

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

.section-header {
  margin-bottom: 22px;
}

.section-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.45);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  margin-bottom: 12px;
  width: fit-content;
}

.card-tag.pucp {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.btn-action {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.9);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
  display: inline-block;
}

.btn-action:hover {
  background: #1d4ed8;
}

/* SIMULACRO INTERACTIVO */
#exam-runner {
  display: none;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 28px;
  margin-top: 24px;
}

.exam-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-glass);
}

.btn-close-exam {
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.question-box {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.question-box h5 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: #f1f5f9;
  line-height: 1.5;
}

.option-label {
  display: block;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.93rem;
  transition: background 0.15s;
}

.option-label:hover {
  background: rgba(59, 130, 246, 0.15);
}

.option-label input {
  margin-right: 10px;
}

#exam-result {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  font-weight: 700;
  display: none;
}

/* BOTÓN FLOTANTE CIRCULAR DE WHATSAPP (ESTILO LOGO VERDE) */
.whatsapp-float {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 62px;
  height: 62px;
  background-color: #128C7E;
  background: linear-gradient(145deg, #25D366, #128C7E);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(18, 140, 126, 0.45);
  z-index: 999;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
  width: 34px;
  height: 34px;
  fill: #ffffff;
}

/* Etiqueta emergente al pasar el mouse por el logo */
.whatsapp-tooltip {
  position: absolute;
  right: 74px;
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: all 0.2s ease;
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 600px) {
  .tabs-bar { flex-direction: column; }
  header.navbar { justify-content: center; text-align: center; }
  .whatsapp-float { bottom: 18px; right: 18px; width: 56px; height: 56px; }
  .whatsapp-float svg { width: 30px; height: 30px; }
}
