/* =========================================================
   EduExam Pro - Exam Glass UI v6
   Opciones más cercanas al ejemplo visual
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --exam-bg: #eef2f8;
  --exam-surface: #ffffff;
  --exam-surface-2: #f8fbff;
  --exam-border: #d9e1ee;
  --exam-text: #182230;
  --exam-muted: #66748b;

  --exam-blue: #2f5ee6;
  --exam-blue-2: #2147c4;
  --exam-blue-soft: #edf3ff;

  --exam-green: #14b889;
  --exam-green-soft: #eafbf5;

  --exam-orange: #f59f00;
  --exam-orange-soft: #fff5d8;

  --exam-red: #e03131;
  --exam-red-soft: #ffe8e8;

  --exam-purple: #6f42f5;
  --exam-purple-soft: #f1ebff;

  --exam-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --exam-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 94, 230, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(111, 66, 245, 0.06), transparent 20%),
    var(--exam-bg);
  color: var(--exam-text);
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  line-height: 1.4;
}

.page.page-exam {
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  min-height: 100vh;
}

#state-loading,
#state-key,
#state-password,
#state-register,
#state-exam,
#state-result {
  display: none;
}

.state-loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--exam-muted);
  font-size: 1rem;
  font-weight: 800;
}

.exam-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.exam-shell {
  max-width: 980px;
  margin: 0 auto;
}

.state-screen {
  width: 100%;
}

.screen-card {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid var(--exam-border);
  border-radius: 30px;
  box-shadow: var(--exam-shadow);
  padding: 30px;
}

.screen-card-compact {
  max-width: 540px;
  margin: 30px auto 0;
}

.screen-center {
  text-align: center;
}

.screen-brand {
  margin-bottom: 18px;
}

.screen-badge,
.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  background: var(--exam-blue-soft);
  color: var(--exam-blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid #d5e2ff;
}

.screen-title {
  margin: 14px 0 8px;
  font-size: 1.8rem;
  line-height: 1.12;
  font-weight: 900;
  color: var(--exam-text);
}

.screen-subtitle {
  margin: 0;
  color: var(--exam-muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.screen-form {
  margin-top: 16px;
}

.exam-header {
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1px solid var(--exam-border);
  border-radius: 26px;
  box-shadow: var(--exam-shadow-soft);
  padding: 18px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.exam-header-live {
  position: sticky;
  top: 12px;
  z-index: 20;
}

.exam-title {
  font-size: 1.22rem;
  font-weight: 900;
  color: var(--exam-text);
  letter-spacing: -0.02em;
}

.exam-meta {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--exam-muted);
}

.exam-meta-live {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--exam-muted);
  line-height: 1.45;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.student-form,
.guard-panel,
.question-card,
.result-card,
.block {
  background: var(--exam-surface);
  border: 1px solid var(--exam-border);
  box-shadow: var(--exam-shadow-soft);
}

.student-form {
  border-radius: 28px;
  padding: 26px;
  margin-bottom: 14px;
}

.student-form h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--exam-text);
}

.field {
  margin-bottom: 16px;
}

.field-left {
  text-align: left;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--exam-muted);
}

.required {
  color: var(--exam-red);
}

.fg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--exam-border);
  background: var(--exam-surface-2);
  color: var(--exam-text) !important;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  font-size: 0.96rem;
  outline: none;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    transform .18s ease;
  -webkit-text-fill-color: var(--exam-text) !important;
}

.input:focus {
  background: #fff;
  border-color: #9bb5ff;
  box-shadow: 0 0 0 4px rgba(47, 94, 230, 0.12);
  transform: translateY(-1px);
}

.input:-webkit-autofill {
  -webkit-text-fill-color: var(--exam-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--exam-surface-2) inset !important;
}

.input-key {
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 14px;
  min-height: 58px;
}

.input-icon-wrap {
  position: relative;
}

.input-with-icon {
  padding-right: 50px;
}

.input-icon-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--exam-muted);
  cursor: pointer;
  font-size: 1rem;
}

.input-icon-btn:hover {
  background: rgba(47, 94, 230, 0.08);
  color: var(--exam-blue);
}

.students-help {
  margin-top: -4px;
  margin-bottom: 6px;
}

.small {
  font-size: 0.86rem;
  color: var(--exam-muted);
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 54px;
  padding: 0.88rem 1.2rem;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 900;
  border: none;
  cursor: pointer;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    opacity .16s ease,
    background .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  width: 100%;
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--exam-blue), var(--exam-blue-2));
  box-shadow: 0 12px 24px rgba(47, 94, 230, 0.20);
}

.btn-primary:hover {
  box-shadow: 0 15px 30px rgba(47, 94, 230, 0.24);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  width: 100%;
  margin-top: 8px;
  color: var(--exam-text);
  background: #fff;
  border: 1px solid var(--exam-border);
}

.timer {
  min-width: 132px;
  text-align: center;
  background: var(--exam-blue-soft);
  color: var(--exam-blue);
  border: 1px solid #c8d6ff;
  border-radius: 16px;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.08rem;
  font-weight: 900;
}

.timer.warn {
  background: var(--exam-orange-soft);
  color: #a96500;
  border-color: #ffd06b;
}

.timer.danger {
  background: var(--exam-red-soft);
  color: #c92a2a;
  border-color: #ffb0b0;
  animation: pulse 0.7s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.guard-panel {
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.guard-stat {
  font-size: 0.84rem;
  color: var(--exam-muted);
}

.guard-stat strong {
  color: var(--exam-text);
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: #e7edf7;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--exam-blue), #6d8cff);
  border-radius: 999px;
  transition: width .25s ease;
}

.nav-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.48rem;
  margin-bottom: 16px;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 1px solid #cdd6e5;
  background: #e9edf5;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.dot:hover {
  transform: scale(1.08);
}

.dot.answered {
  background: var(--exam-blue);
  border-color: var(--exam-blue);
  box-shadow: 0 0 0 4px rgba(47, 94, 230, 0.10);
}

.questions-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-card {
  border-radius: 24px;
  padding: 20px 20px 18px;
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
}

.question-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--exam-blue), #7a97ff);
  opacity: 0;
  transition: opacity .18s ease;
}

.question-card.answered::before {
  opacity: 1;
}

.question-card.answered {
  border-color: #b6c8ff;
  box-shadow: 0 10px 24px rgba(47, 94, 230, 0.08);
}

.question-card-review {
  margin-bottom: 12px;
}

.question-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.q-num {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  background: var(--exam-blue-soft);
  color: var(--exam-blue);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.q-stem {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--exam-text);
  margin-bottom: 16px;
  font-weight: 800;
}

.anti-ai-notice

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-height: 68px;
  width: 100%;
  padding: 1rem 1rem;
  border-radius: 20px;
  border: 1px solid #d8deeb;
  background: #ffffff;
  cursor: pointer;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease,
    background .16s ease;
  overflow: hidden;
}

.option::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.option:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.option.selected {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.opt-tone-1 {
  border-left: 8px solid var(--exam-blue);
  background: linear-gradient(90deg, rgba(47,94,230,0.08), rgba(255,255,255,0.95) 24%);
}

.opt-tone-2 {
  border-left: 8px solid var(--exam-green);
  background: linear-gradient(90deg, rgba(20,184,137,0.08), rgba(255,255,255,0.95) 24%);
}

.opt-tone-3 {
  border-left: 8px solid var(--exam-orange);
  background: linear-gradient(90deg, rgba(245,159,0,0.08), rgba(255,255,255,0.95) 24%);
}

.opt-tone-4 {
  border-left: 8px solid var(--exam-red);
  background: linear-gradient(90deg, rgba(224,49,49,0.08), rgba(255,255,255,0.95) 24%);
}

.opt-tone-5 {
  border-left: 8px solid var(--exam-purple);
  background: linear-gradient(90deg, rgba(111,66,245,0.08), rgba(255,255,255,0.95) 24%);
}

.option.selected.opt-tone-1 {
  border-color: #91abff;
  background: linear-gradient(90deg, rgba(47,94,230,0.14), rgba(237,243,255,0.92) 28%);
}

.option.selected.opt-tone-2 {
  border-color: rgba(20,184,137,0.35);
  background: linear-gradient(90deg, rgba(20,184,137,0.14), rgba(234,251,245,0.92) 28%);
}

.option.selected.opt-tone-3 {
  border-color: rgba(245,159,0,0.35);
  background: linear-gradient(90deg, rgba(245,159,0,0.14), rgba(255,245,216,0.92) 28%);
}

.option.selected.opt-tone-4 {
  border-color: rgba(224,49,49,0.35);
  background: linear-gradient(90deg, rgba(224,49,49,0.14), rgba(255,232,232,0.92) 28%);
}

.option.selected.opt-tone-5 {
  border-color: rgba(111,66,245,0.35);
  background: linear-gradient(90deg, rgba(111,66,245,0.14), rgba(241,235,255,0.92) 28%);
}

.opt-radio {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #d0d7e4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  position: relative;
  z-index: 1;
}

.option.selected .opt-radio {
  border-color: var(--exam-text);
}

.opt-radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--exam-text);
  display: none;
}

.option.selected .opt-radio-dot {
  display: block;
}

.opt-label {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--exam-text);
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.option.correct {
  border-color: rgba(20, 184, 137, 0.35);
  background: rgba(20, 184, 137, 0.10) !important;
}

.option.wrong {
  border-color: rgba(224, 49, 49, 0.35);
  background: rgba(224, 49, 49, 0.10) !important;
}

.question-tags,
.review-tags {
  margin-top: 12px;
}

.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: #f5f7fb;
  border: 1px solid #d8deeb;
  color: var(--exam-muted);
  font-size: 0.77rem;
  font-weight: 800;
}

.chip.good {
  color: #0f8c67;
  background: rgba(20, 184, 137, 0.08);
  border-color: rgba(20, 184, 137, 0.22);
}

.chip.bad {
  color: #c92a2a;
  background: rgba(224, 49, 49, 0.08);
  border-color: rgba(224, 49, 49, 0.22);
}

.explanation {
  margin-top: 12px;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border-left: 4px solid var(--exam-green);
  background: rgba(20, 184, 137, 0.08);
  color: var(--exam-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.submit-wrap {
  margin-top: 18px;
}

.alert {
  padding: 1rem 1rem;
  border-radius: 16px;
  font-size: 0.93rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.alert-inline {
  margin: 0;
}

.alert-error {
  background: rgba(224, 49, 49, 0.08);
  border: 1px solid rgba(224, 49, 49, 0.20);
  color: #c92a2a;
}

.alert-info {
  background: rgba(47, 94, 230, 0.08);
  border: 1px solid rgba(47, 94, 230, 0.18);
  color: var(--exam-blue);
}

.result-card {
  border-radius: 30px;
  padding: 30px 24px;
  text-align: center;
  margin-top: 8px;
}

.result-circle {
  width: 136px;
  height: 136px;
  border-radius: 999px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  border: 6px solid;
}

.result-circle.passed {
  border-color: var(--exam-green);
  color: #0f8c67;
  background: rgba(20, 184, 137, 0.08);
}

.result-circle.failed {
  border-color: var(--exam-red);
  color: #c92a2a;
  background: rgba(224, 49, 49, 0.08);
}

.result-title {
  font-size: 1.62rem;
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.result-sub {
  color: var(--exam-muted);
  margin-bottom: 1rem;
  font-size: 0.96rem;
}

.result-meta-extra {
  margin: 0 auto 14px;
  max-width: 760px;
  text-align: center;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.rs {
  background: var(--exam-surface-2);
  border: 1px solid #dde4f0;
  border-radius: 20px;
  padding: 1rem;
}

.rs-l {
  font-size: 0.74rem;
  color: var(--exam-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.rs-v {
  font-size: 1.38rem;
  font-weight: 900;
  color: var(--exam-text);
}

.block {
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  margin-top: 14px;
}

.block h3 {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 8px;
  color: var(--exam-blue);
}

.hr {
  height: 1px;
  background: #e2e8f0;
  margin: 0.95rem 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin-top: 0.65rem;
}

.table th,
.table td {
  padding: 0.58rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.table th {
  text-align: left;
  color: var(--exam-muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rankline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.rankname {
  color: var(--exam-text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.rankmeta {
  color: var(--exam-muted);
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  padding: 0.2rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid #c7d2fe;
  color: var(--exam-blue);
  background: #eef2ff;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.result-actions .btn {
  max-width: 300px;
  width: auto;
  min-width: 220px;
  margin-top: 0;
}

.student-lookup-wrap {
  position: relative;
}

.student-lookup-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border: 1px solid #dbe2ee;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  overflow: hidden;
  z-index: 30;
}

.student-lookup-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  color: var(--exam-text);
}

.student-lookup-item:hover {
  background: #f5f8ff;
}

.student-lookup-name {
  font-weight: 800;
  color: var(--exam-text);
}

.student-lookup-id {
  font-size: 0.86rem;
  color: var(--exam-muted);
}

.student-lookup-status {
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--exam-muted);
}

.analysis-subtitle {
  display: block;
}

.analysis-list {
  margin: 0;
}

.theme-toggle {
  min-width: 138px;
}

@media (max-width: 900px) {
  .page.page-exam {
    padding: 14px 12px 28px;
  }

  .exam-shell {
    max-width: 100%;
  }

  .exam-header {
    padding: 16px;
  }

  .student-form,
  .question-card,
  .result-card,
  .block {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 700px) {
  .fg {
    grid-template-columns: 1fr;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .result-actions .btn {
    min-width: 100%;
    max-width: 100%;
  }

  .screen-title {
    font-size: 1.45rem;
  }

  .q-stem {
    font-size: 1rem;
  }

  .opt-label {
    font-size: 0.95rem;
  }
}

@media (max-width: 520px) {
  .page.page-exam {
    padding: 12px 10px 24px;
  }

  .screen-card,
  .student-form,
  .question-card,
  .result-card,
  .block,
  .guard-panel,
  .exam-header {
    border-radius: 22px;
  }

  .screen-card {
    padding: 22px 16px;
  }

  .student-form,
  .question-card,
  .result-card,
  .block {
    padding: 16px 14px;
  }

  .option {
    min-height: 60px;
    padding: 0.9rem 0.9rem;
    border-radius: 18px;
  }

  .input {
    min-height: 48px;
  }

  .btn {
    min-height: 50px;
  }
}