/* ALBA Android · Edición profesional v1.1
 * Estilos exclusivos de APK. No modifica el proyecto web de Ubuntu.
 * Diseñados para teléfonos 360-480dp y tabletas Android.
 */
:root {
  --alba-blue: #0863cd;
  --alba-blue-deep: #052e62;
  --alba-ink: #091c33;
  --alba-white: #ffffff;
  --alba-green: #007f69;
}
html { -webkit-text-size-adjust: 100%; }
body { background: #f2f7fd; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid #62d8ff !important; outline-offset: 3px;
}
.app { max-width: 1200px; }

/* 1. Portada: mantener el escudo original, reforzar la jerarquía
   y añadir la autoría legible en blanco negrita. */
.app.welcome-active { max-width:none; }
.welcome-screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(40px, calc(20px + env(safe-area-inset-top))) 18px
    max(38px, calc(22px + env(safe-area-inset-bottom)));
  background:
    radial-gradient(ellipse at 50% 23%, #173e70 0%, #0c2a52 36%, #061a39 76%, #06152f 100%);
}
.welcome-inner {
  width: min(100%, 620px);
  gap: clamp(13px, 2.5vh, 24px);
  margin: auto;
}
.welcome-inner .academy-logo {
  width: clamp(170px, 58vw, 270px);
  max-height: 35dvh;
  object-fit: contain;
  filter: drop-shadow(0 9px 22px rgba(0,0,0,.23));
}
.welcome-inner h1 {
  max-width: 600px;
  font-size: clamp(21px, 5vw, 32px);
  font-weight: 900; line-height:1.29;
  letter-spacing: .35px;
  color:#fff;
}
#welcome .welcome-cta {
  width: min(85vw, 375px); min-height: 58px;
  background:linear-gradient(180deg,#117ff0 0%,#0757b9 100%);
  border:1px solid #249cff;
  color:white; font-size:clamp(17px,4.6vw,23px);
  font-weight:900; letter-spacing:1px; border-radius:15px;
  box-shadow:0 9px 24px #00152f6b;
}
#welcome .welcome-offline {
  color: #f6d878; font-weight:850; font-size:clamp(13px,3.5vw,16px);
  line-height:1.48; text-align:center; margin:0;
}
#welcome .welcome-credit {
  margin: 10px 0 0;
  color:#fff; font-weight:900; font-size:clamp(11px, 3vw, 15px);
  line-height:1.55; letter-spacing:.65px; text-align:center;
  text-shadow:0 2px 5px #0006;
  text-wrap:balance;
}
#welcome .welcome-credit strong { font-weight:950; color:#fff; }

/* 2. Encabezado común: separado de la barra de estado del móvil,
      título negro en negrita, escudo más abajo y botón profesional. */
.app:not(.welcome-active) { background:#f2f7fd; }
.app:not(.welcome-active) .masthead {
  position:relative;
  margin: 0 auto; padding: max(34px, calc(17px + env(safe-area-inset-top))) 15px 17px;
  background:linear-gradient(180deg,#fff,#eef6ff);
  border-bottom:1px solid #cbdff4;
  box-shadow:0 2px 12px #113e6414;
  gap:12px;
}
.masthead .brand { min-width:0; gap:11px; flex:1 1 auto; }
.masthead .brand-logo {
  display:block; width:55px; height:59px; flex:0 0 55px; object-fit:contain;
  filter:drop-shadow(0 2px 4px #12375a36);
}
.masthead .brand strong {
  font-size:clamp(13px,3.7vw,17px);
  font-weight:950; color:#101b2e; line-height:1.24;
  letter-spacing:.1px; max-width:320px;
}
.masthead .brand small {
  font-size:12px; font-weight:750; color:#455d77; margin-top:4px;
}
.masthead #openProgress {
  display:inline-flex !important;
  justify-content:center; align-items:center; flex:0 0 auto;
  color:#fff; background:linear-gradient(180deg,#1265c1,#09437f);
  border:1px solid #307ac2; border-radius:14px;
  box-shadow:0 3px 11px #0b3e7925;
  letter-spacing:.2px;
  font-size:clamp(11px,2.9vw,13px); font-weight:900;
  padding:12px 13px; min-height:46px; text-decoration:none;
  white-space:normal; text-align:center; max-width:128px;
}
.app:not(.welcome-active) main { padding:14px 15px max(30px,env(safe-area-inset-bottom)); }

/* 3. Inicio: reducir altura del cuadro principal y airear tarjetas. */
#home .hero:not(.welcome-screen) {
  min-height:0; padding:24px 24px; margin:3px 0 14px;
  border-radius:22px;
  background:linear-gradient(123deg,#0a2b53 5%,#14517e 57%,#087a82 130%);
  box-shadow:0 8px 22px #12385e16;
}
#home .hero .eyebrow { font-size:11px; font-weight:850; letter-spacing:1.5px; }
#home .hero h1 {
  margin:11px 0; font-size:clamp(30px,7vw,42px);
  line-height:1.13; letter-spacing:-.5px;
}
#home .hero p { font-size:clamp(13px,3.7vw,16px); line-height:1.52; margin:11px 0; }
#home .hero-flags { gap:11px; margin-top:17px; font-size:12px; }
#home .stats { gap:10px; margin:13px 0; }
#home .stats article {
  background:linear-gradient(155deg,#0e365c,#145b83);
  border:1px solid #4d8fb0; border-radius:16px;
  padding:14px 12px; color:white;
  box-shadow:0 5px 14px #114c7019;
}
#home .stats article label {
  font-size:clamp(11px,3vw,13px); font-weight:850; color:#fff;
  text-transform:uppercase; line-height:1.3;
}
#home .stats article b { color:#fff; }
#home .stats .block-best-grid small,
#home .stats .block-best-hint, #home .stats .timer-description { color:#e4f0fd; }
#home .panel.settings { border-radius:18px; box-shadow:0 5px 18px #0b355514; }

/* 4. Test: azul Policía en torno a una tarjeta clara.
   El campo del enunciado y las respuestas siguen en blanco. */
#quiz {
  color:#fff;
  background:linear-gradient(157deg,#08396f 0%,#07529d 45%,#062b60 100%);
  border-radius:17px; margin:0 -10px 12px;
  padding:12px 13px 26px;
  min-height:calc(100dvh - 160px);
}
#quiz .quiz-header {
  background:transparent; border:0; box-shadow:none; border-radius:0;
  position:relative; top:auto; margin:2px 0 12px; padding:2px 0;
  display:flex; gap:7px;
}
#quiz .back, #quiz .timer { color:#fff; font-weight:850; }
#quiz .back { padding:8px 4px; min-width:48px; }
#quiz .mode-tag {
  background:linear-gradient(135deg,#147bff,#085bd0);
  border:1px solid #50b1ff; color:#fff;
  border-radius:999px;
  font-size:clamp(12px,3.4vw,15px); font-weight:900;
  padding:10px 12px; text-align:center;
}
#quiz .quiz-meta {
  color:#eaf6ff; font-size:clamp(13px,3.7vw,16px);
  line-height:1.4; align-items:flex-start;
  margin:14px 0 14px; gap:8px;
}
#quiz .quiz-meta strong, #quiz #topicLabel {
  color:#fff!important; font-weight:900;
  text-align:right; max-width:67%;
}
#quiz .progress {
  background:#74a8d6; height:8px; margin:0 0 18px;
  border-radius:999px;
}
#quiz .progress>div { background:linear-gradient(90deg,#25e0ce,#54ffd8); }
#quiz .question-card {
  color:#091e39; max-width:100%;
  background:linear-gradient(160deg,#e5f2ff 0%,#cbe6fa 100%);
  border:1px solid #82b8e6;
  box-shadow:0 9px 24px #001e4761;
  border-radius:22px; padding:18px 16px 21px;
}
#quiz .qchips { gap:9px; font-size:12px; line-height:1.45; }
#quiz .qchips span {
  background:#f7fbff; border:1px solid #b4cfe7;
  border-radius:12px; color:#101010;
  font-weight:850; padding:9px 12px; max-width:100%;
}
#quiz #levelLabel {
  background:#ffe6e5; color:#111;
  border-color:#f0acac; font-weight:950;
}
#quiz #refLabel { flex:1 1 190px; color:#111; font-weight:850; }
#quiz .question-card #questionText {
  background:#fff; color:#050505;
  border:1px solid #cae0f2;
  border-radius:17px; font-size:clamp(22px,5.7vw,29px);
  font-weight:900; line-height:1.39; letter-spacing:-.3px;
  padding:18px 15px; margin:17px 0 15px;
}
#quiz .answer-options { gap:12px; }
#quiz .answer {
  min-height:64px; border:1.5px solid #aed0ea; border-radius:16px;
  background:#fff; color:#111d2c;
  padding:15px 13px; gap:13px;
  font-size:clamp(15px,4vw,18px);
  line-height:1.5; font-weight:500;
  box-shadow:0 2px 4px #0b44600a;
}
#quiz .answer .letter {
  background:linear-gradient(135deg,#e4f4ff,#d0e8fa);
  min-width:36px; height:36px; flex-basis:36px; color:#102e54;
  font-weight:900; font-size:18px; border-radius:9px;
}
#quiz .answer.selected { background:#edf8ff; border-color:#1f82c6; }
#quiz .answer.correct { background:#e8fff4; border-color:#08846b; }
#quiz .answer.wrong { background:#fff0f1; border-color:#b63f56; }
#quiz .feedback { background:#fff; color:#0c2440; }
#quiz .qfooter { gap:10px; flex-wrap:nowrap; margin-top:19px; }
#quiz .qfooter button {
  flex:1 1 50%; min-height:54px; font-size:clamp(12px,3.4vw,15px);
  font-weight:900; padding:12px 9px; border-radius:12px;
  white-space:normal;
}
#quiz #skip {
  background:#fff; color:#0a0a0a; border:1px solid #dae6f3;
  box-shadow:0 3px 9px #11436914;
}
#quiz #next {
  background:linear-gradient(140deg,#05977b,#046653);
  color:#fff; border:1px solid #20b99b;
  box-shadow:0 4px 12px #00453529;
}
#quiz #next:disabled { opacity:.56; }
#quiz .question-help { color:#d7eaff; }

/* 5. Oca: contraste alto y botones de navegación uniformes. */
#oca .oca-top .oca-exit,
#oca .oca-bottom #ocaReset {
  background:linear-gradient(180deg,#1478e4,#0651a5);
  border:1px solid #2588f6; color:#fff;
  font-weight:900; border-radius:13px;
  min-height:47px; padding:10px 17px;
  box-shadow:0 3px 11px #0a4f951d;
}
#oca .oca-top h1 { color:#0c2f57; font-weight:950; }
#oca .oca-question #ocaQuestionText { color:#090f19; font-weight:850; }
#oca .oca-answer { font-weight:700; color:#09284d; }
#oca .oca-bottom { padding:8px 0 28px; }

/* 6. Historial/progreso: mismo encabezado separado de la barra de Android. */
.dashboard-body { background:#f2f7fd; }
.report-nav {
  padding: max(33px,calc(17px + env(safe-area-inset-top))) 16px 16px;
  background:linear-gradient(180deg,#fff,#edf6ff);
  box-shadow:0 2px 12px #0d406417;
}
.report-brand img { width:55px; height:60px; object-fit:contain; }
.report-brand strong { font-size:clamp(12px,3.4vw,16px); font-weight:950; color:#091b2d; }
.report-brand small { color:#4c6276; font-weight:750; }
.report-back {
  background:linear-gradient(180deg,#1366c0,#0a457e);
  color:#fff; border:1px solid #3185d0;
  border-radius:13px; font-weight:900; font-size:12px;
  padding:11px 12px; white-space:normal; text-align:center; max-width:135px;
}
.report-main { padding:20px 15px 65px; }

/* Estado táctil para móviles pequeños. */
@media (max-width:550px) {
  .app:not(.welcome-active) .masthead { padding-left:13px; padding-right:12px; }
  .masthead .brand-logo {width:50px;height:54px;flex-basis:50px;}
  .masthead .brand strong {font-size:clamp(12px,3.6vw,15px);}
  .masthead #openProgress { max-width:112px; padding:11px 10px; font-size:11px; }
  #home .hero:not(.welcome-screen) {padding:21px 20px;}
  #home .hero h1 {font-size:clamp(29px,7.3vw,38px);}
  #home .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #home .stats article {padding:15px 12px;}
  #quiz .question-card {padding:14px 12px 19px;}
  #quiz .question-card #questionText {padding:17px 13px;font-size:clamp(20px,5.45vw,25px);}
  #quiz .answer {padding:14px 12px;}
  #quiz .quiz-header .timer {font-size:12px;}
  #quiz .mode-tag {font-size:12px;}
  .report-nav {padding-left:13px;padding-right:13px;}
  .report-brand img {width:49px;height:54px;}
  .report-brand strong {font-size:12px;}
  .report-back {max-width:106px;font-size:11px;}
}
@media (max-height:720px) {
  .welcome-inner .academy-logo {max-height:31dvh;}
  .welcome-inner {gap:11px;}
  .welcome-inner h1 {font-size:clamp(19px,4.5vw,25px);}
  #welcome .welcome-cta {min-height:51px;}
  #welcome .welcome-credit {margin-top:1px;}
}
