:root {
  --navy: #12345b;
  --navy-2: #0a2443;
  --blue: #2377c3;
  --cyan: #1ba7a1;
  --orange: #f28c3a;
  --red: #d94d4d;
  --green: #38a36d;
  --yellow: #f7c84b;
  --purple: #7467d8;
  --light: #f2f7fa;
  --paper: #ffffff;
  --dark: #183042;
  --muted: #647985;
  --line: #dce8ef;
  --shadow: 0 14px 35px rgba(18, 52, 91, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--dark);
  background:
    radial-gradient(circle at 12% 5%, rgba(27, 167, 161, 0.11), transparent 22rem),
    radial-gradient(circle at 88% 18%, rgba(35, 119, 195, 0.10), transparent 24rem),
    #eef5f8;
}

button { font: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(247, 200, 75, 0.9);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 999;
  background: #fff;
  color: var(--navy);
  padding: 12px;
  border-radius: 10px;
}

.skip-link:focus { left: 10px; }

.institution {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.93);
  border-radius: 18px 18px 0 0;
}

.institution h1 {
  margin: 0 0 6px;
  font-size: clamp(1.15rem, 3vw, 1.75rem);
  color: #080808;
}

.institution p {
  margin: 3px 0;
  font-size: clamp(0.88rem, 2.1vw, 1.02rem);
}

.institution .location {
  font-weight: 800;
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.school-logo {
  width: 150px;
  height: auto;
  max-height: 150px;
  flex: 0 0 auto;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  filter: drop-shadow(0 6px 8px rgba(18, 52, 91, 0.14));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 13px 18px;
  background: var(--navy);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 20px rgba(18,52,91,.22);
}

.topbar > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.status {
  color: #cae8f4;
  font-size: .86rem;
}

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

.score-pill {
  background: #fff;
  color: var(--navy);
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.ghost-button {
  border: 1px solid rgba(255,255,255,.55);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 34px;
  background: rgba(255,255,255,.52);
  padding: 26px;
  border-radius: 0 0 24px 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 30px;
  align-items: center;
  background: #fff;
  padding: clamp(24px, 5vw, 44px);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.eyebrow,
.mission-label {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--cyan);
  font-weight: 900;
  letter-spacing: .08em;
  font-size: .8rem;
}

.hero h2 {
  margin: 0 0 13px;
  color: var(--navy);
  font-size: clamp(2rem, 6vw, 3.45rem);
  line-height: 1.02;
}

.hero p {
  font-size: clamp(1rem, 2.6vw, 1.16rem);
  line-height: 1.55;
}

.privacy-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 7px solid var(--orange);
  border-radius: 12px;
  background: #fff7e8;
  line-height: 1.45;
}

.hero-art {
  min-height: 250px;
  position: relative;
  display: grid;
  place-items: center;
}

.shield {
  width: 190px;
  height: 218px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(145deg, var(--cyan), #0f8f8a);
  clip-path: polygon(50% 0, 90% 18%, 84% 70%, 50% 100%, 16% 70%, 10% 18%);
  filter: drop-shadow(0 16px 17px rgba(27,167,161,.32));
}

.orbit {
  position: absolute;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 1.4rem;
}

.orbit-one { top: 4%; left: 5%; }
.orbit-two { top: 17%; right: 0; }
.orbit-three { bottom: 5%; left: 4%; }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.tab {
  border: 0;
  border-radius: 15px;
  padding: 13px 12px;
  color: var(--navy);
  background: #ddeaf1;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s, background .15s;
}

.tab span {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-right: 5px;
  border-radius: 50%;
  background: rgba(18,52,91,.12);
}

.tab:hover { transform: translateY(-2px); }
.tab.active { background: var(--cyan); color: #fff; }
.tab.active span { background: rgba(255,255,255,.22); }

.panel { display: none; }
.panel.active { display: block; animation: rise .25s ease-out; }

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

.card {
  padding: clamp(18px, 4vw, 32px);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.card-heading h3 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.card-heading p { margin: 0; color: var(--muted); }

.icon-box {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-size: 2rem;
}

.icon-box.cyan { background: #e6f8f6; }
.icon-box.orange { background: #fff1e3; }
.icon-box.purple { background: #f0edff; }

.progress-info {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 8px 2px;
  color: var(--muted);
  font-size: .92rem;
}

.progress {
  height: 13px;
  margin-bottom: 22px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5edf2;
}

.bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width .3s ease;
}

.orange-bar { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.purple-bar { background: linear-gradient(90deg, var(--purple), var(--blue)); }

.phone-frame {
  max-width: 730px;
  margin: 0 auto;
  padding: 18px;
  border: 10px solid var(--navy);
  border-radius: 30px;
  background: #edf5f8;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7);
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid #cfdee7;
}

.phone-top small,
.fake-profile small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.avatar,
.fake-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: #fff;
  font-weight: 900;
}

.bubble {
  width: min(88%, 600px);
  margin: 22px 0 4px auto;
  padding: 16px 18px;
  border-radius: 20px 20px 5px 20px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(18,52,91,.09);
  font-size: 1.08rem;
  line-height: 1.45;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.choice {
  min-height: 104px;
  padding: 15px 11px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  box-shadow: 0 8px 17px rgba(18,52,91,.12);
  transition: transform .15s, filter .15s;
}

.choice:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.04); }
.choice:disabled { cursor: not-allowed; opacity: .76; }
.choice span { font-size: 1.5rem; }
.choice small { font-size: .76rem; }
.choice.safe { background: var(--green); }
.choice.alert { background: var(--orange); }
.choice.block { background: var(--red); }

.feedback {
  display: none;
  margin-top: 16px;
  padding: 15px 17px;
  border-radius: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.feedback.good {
  display: block;
  color: #17663f;
  background: #e6f7ed;
  border: 1px solid #76c99d;
}

.feedback.bad {
  display: block;
  color: #952e2e;
  background: #fff0ef;
  border: 1px solid #eaa09d;
}

.center { text-align: center; }

.hidden { display: none !important; }

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 14px;
  padding: 13px 21px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button { color: #fff; background: var(--navy); }
.secondary-button { color: var(--navy); background: #dfeaf1; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.05); }

.profile-card {
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.fake-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: var(--navy);
  color: #fff;
}

.fake-profile small { color: #cae5ef; }

.settings { padding: 13px; }

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0;
  padding: 14px 15px;
  border: 2px solid transparent;
  border-radius: 15px;
  background: #f4f8fa;
}

.setting strong { color: var(--navy); }
.setting .description { margin-top: 4px; color: var(--muted); font-size: .86rem; }

.setting.ok { border-color: #69c897; background: #e9f8f0; }
.setting.warn { border-color: #e9a775; background: #fff2e8; }

.switch {
  width: 66px;
  height: 36px;
  flex: 0 0 auto;
  position: relative;
  border: 0;
  border-radius: 999px;
  background: #b9c7cf;
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 7px rgba(0,0,0,.2);
  transition: left .2s;
}

.switch.on { background: var(--cyan); }
.switch.on::after { left: 34px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin-top: 20px;
}

.scenario-box {
  max-width: 860px;
  margin: 0 auto 20px;
  padding: 16px 18px;
  border-left: 7px solid var(--red);
  border-radius: 13px;
  background: #fff0ef;
  line-height: 1.5;
}

.route-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.route-layout h4 {
  margin: 0 0 10px;
  color: var(--navy);
}

.action-bank,
.route-list {
  min-height: 292px;
  padding: 14px;
  border: 2px dashed #b9cbd6;
  border-radius: 18px;
  background: #f5f9fb;
}

.route-list {
  margin: 0;
  padding-left: 48px;
}

.action-chip {
  width: 100%;
  margin: 7px 0;
  padding: 13px 14px;
  border: 0;
  border-radius: 13px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(18,52,91,.09);
  cursor: pointer;
}

.action-chip:hover { background: #e9f6f5; }
.action-chip:disabled { opacity: .55; cursor: not-allowed; }

.route-item {
  margin: 7px 0;
  padding: 13px 14px;
  border-radius: 13px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(18,52,91,.09);
  cursor: pointer;
}

.route-item::marker { color: var(--purple); font-weight: 900; }

.result-card { text-align: center; }

.certificate {
  max-width: 820px;
  margin: 18px auto;
  padding: clamp(22px, 5vw, 42px);
  border: 5px solid var(--cyan);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(27,167,161,.11), transparent 18rem),
    #fff;
}

.certificate-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.certificate-top h4 {
  margin: 3px 0;
  color: var(--navy);
  font-size: 1.6rem;
}

.medal {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  font-size: 2rem;
}

.final-score {
  margin: 22px 0 8px;
  color: var(--navy);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 900;
  line-height: .9;
}

.final-score small { font-size: 1.1rem; }

.certificate h5 {
  margin: 14px 0 6px;
  color: var(--cyan);
  font-size: clamp(1.2rem, 4vw, 2rem);
}

.badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 23px;
}

.badges div {
  min-height: 112px;
  padding: 13px 7px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 16px;
  color: #fff;
  background: var(--navy);
}

.badges div:nth-child(2) { background: var(--cyan); }
.badges div:nth-child(3) { background: var(--orange); }
.badges div:nth-child(4) { background: var(--purple); }
.badges span { font-size: 1.75rem; }
.badges b { font-size: .75rem; }

.capture-tip,
.teacher-note {
  color: var(--muted);
  font-size: .9rem;
}

.teacher-note {
  margin-top: 20px;
  padding: 14px 17px;
  border-radius: 14px;
  background: #e9f4f8;
}

footer {
  padding: 18px;
  color: #70838e;
  text-align: center;
  font-size: .84rem;
}

@media (max-width: 820px) {
  .institution { align-items: flex-start; }
  .school-logo { width: 108px; max-height: 108px; }
  .topbar { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 220px; }
  .tabs { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: 1fr; }
  .route-layout { grid-template-columns: 1fr; }
  .badges { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .institution { padding: 14px; }
  .school-logo { display: none; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column-reverse; align-items: flex-end; }
  .ghost-button { display: none; }
  .page-shell { width: min(100% - 16px, 1120px); padding: 14px; }
  .tabs { grid-template-columns: 1fr; }
  .tab { text-align: left; }
  .card-heading { align-items: flex-start; }
  .icon-box { width: 58px; height: 58px; }
  .progress-info { font-size: .8rem; }
  .setting { align-items: flex-start; }
  .certificate-top { flex-direction: column; }
}

@media print {
  body { background: #fff; }
  .institution, .topbar, .hero, .tabs, .teacher-note, footer,
  .panel:not(#resultado), .button-row, .capture-tip { display: none !important; }
  .page-shell { width: 100%; padding: 0; background: #fff; }
  #resultado { display: block !important; }
  .card { box-shadow: none; padding: 0; }
  .certificate { break-inside: avoid; }
}
