/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #CC1F26;
  --orange:       #CC1F26;
  --orange-dark:  #A01820;
  --orange-light: #FDEAEA;
  --orange-mid:   #D94F55;
  --navy:         #1A2235;
  --navy-mid:     #243050;
  --navy-light:   #2E3A55;
  --text:         #1A202C;
  --text-muted:   #4A5568;
  --text-hint:    #718096;
  --bg:           #F0F2F5;
  --surface:      #FFFFFF;
  --surface2:     #F7F8FA;
  --border:       rgba(0,0,0,0.09);
  --border-med:   rgba(0,0,0,0.15);
  --radius:       8px;
  --radius-lg:    12px;
  --shadow:       0 2px 8px rgba(0,0,0,0.4);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

/* ── NAV ────────────────────────────────────────────────────── */
.navbar { background: #FFFFFF; border-bottom: 1px solid rgba(0,0,0,0.1); padding: 0 1.5rem; height: 58px; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav-brand-bm { font-size: 17px; font-weight: 900; color: var(--red); letter-spacing: .03em; }
.nav-brand-bm span { color: var(--red); }
.nav-brand-sub { font-size: 9px; font-weight: 700; color: #4A5568; text-transform: uppercase; letter-spacing: .15em; }
.nav-links { display: flex; gap: 2px; margin-left: 2rem; }
.nav-link { padding: 6px 14px; border-radius: var(--radius); font-size: 13px; color: var(--text-muted); text-decoration: none; transition: all .15s; font-weight: 500; }
.nav-link:hover { background: var(--navy-light); color: var(--text); }
.nav-link.active { background: var(--navy-light); color: var(--orange); }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-left: 1rem; border-left: 1px solid var(--border); }
.nav-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.nav-user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.nav-user-rol  { font-size: 11px; color: var(--text-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.main-content { flex: 1; padding: 2rem 1.5rem; max-width: 980px; margin: 0 auto; width: 100%; }
.footer { text-align: center; padding: 1rem; font-size: 12px; color: #94A3B8; border-top: 1px solid rgba(0,0,0,0.1); background: #1A2235; }

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-title  { font-size: 20px; font-weight: 700; margin-bottom: 3px; color: var(--text); }
.page-sub    { font-size: 13px; color: var(--text-muted); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title  { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── METRICS ─────────────────────────────────────────────────── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.metric { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; position: relative; overflow: hidden; }
.metric::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--orange); }
.metric-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.metric-value { font-size: 26px; font-weight: 700; color: var(--text); }
.metric-sub   { font-size: 12px; color: var(--text-hint); margin-top: 2px; }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .06em; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-green  { background: rgba(34,197,94,0.15);  color: #4ADE80; border: 1px solid rgba(34,197,94,0.2); }
.badge-red    { background: rgba(239,68,68,0.15);  color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-amber  { background: rgba(245,158,11,0.15); color: #FCD34D; border: 1px solid rgba(245,158,11,0.2); }
.badge-blue   { background: rgba(59,130,246,0.15); color: #93C5FD; border: 1px solid rgba(59,130,246,0.2); }
.badge-gray   { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-med); background: var(--surface2); color: var(--text); text-decoration: none; transition: all .15s; }
.btn:hover { background: var(--navy-light); border-color: rgba(255,255,255,0.2); }
.btn-primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-danger { color: #F87171; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }
.btn-danger:hover { background: rgba(239,68,68,0.15); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border-med); border-radius: var(--radius); font-size: 13px; background: #FFFFFF; color: #1A202C; font-family: inherit; transition: border-color .15s; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(204,31,38,.15); }

/* ── UPLOAD ZONE ─────────────────────────────────────────────── */
.upload-zone { border: 1.5px dashed var(--border-med); border-radius: var(--radius-lg); padding: 2rem 1rem; text-align: center; cursor: pointer; background: #F7F8FA; transition: all .15s; }
.upload-zone:hover { border-color: var(--orange); background: rgba(204,31,38,.05); }
.upload-zone p { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.upload-zone .upload-icon { font-size: 2rem; line-height: 1; }

/* ── STEPS ──────────────────────────────────────────────────── */
.steps { display: flex; align-items: center; margin-bottom: 2rem; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-hint); white-space: nowrap; }
.step-num { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-med); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.step.active { color: var(--text); font-weight: 600; }
.step.active .step-num { background: var(--orange); border-color: var(--orange); color: #fff; }
.step.done .step-num { background: rgba(204,31,38,.2); border-color: var(--orange); color: var(--orange); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; min-width: 20px; }

/* ── SELECTABLE CARDS ─────────────────────────────────────────── */
.select-list { display: flex; flex-direction: column; gap: 8px; }
.select-card { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all .15s; background: var(--surface2); font-size: 14px; color: var(--text); text-decoration: none; }
.select-card:hover { border-color: var(--orange-mid); background: rgba(204,31,38,.06); }
.select-card.selected { border-color: var(--orange); background: rgba(204,31,38,.12); color: var(--orange-mid); font-weight: 600; }
.select-icon { font-size: 1.1rem; }

/* ── EXAM QUESTIONS ──────────────────────────────────────────── */
.question-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1rem; }
.question-num  { font-size: 11px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.question-text { font-size: 14px; font-weight: 500; margin-bottom: 14px; line-height: 1.5; color: var(--text); }
.option { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; font-size: 13px; transition: all .12s; margin-bottom: 5px; color: var(--text); }
.option:hover { background: var(--surface2); border-color: var(--border); }
.option.selected { background: rgba(204,31,38,.12); border-color: var(--orange-mid); color: #fff; }
.option.correct  { background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.4);  color: #4ADE80; }
.option.wrong    { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.4);  color: #F87171; }
.option input[type=radio] { accent-color: var(--orange); flex-shrink: 0; }

/* ── RESULT CIRCLE ───────────────────────────────────────────── */
.result-wrap { text-align: center; padding: 2rem 1rem; }
.score-circle { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--orange); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 1.25rem; background: rgba(204,31,38,.08); }
.score-circle.fail { border-color: #EF4444; background: rgba(239,68,68,.08); }
.score-pct  { font-size: 32px; font-weight: 800; color: var(--orange); }
.score-circle.fail .score-pct { color: #F87171; }
.score-frac { font-size: 12px; color: var(--text-muted); }

/* ── ALERT ───────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 1rem; }
.alert-danger  { background: rgba(239,68,68,.12);  color: #F87171; border: 1px solid rgba(239,68,68,.25); }
.alert-success { background: rgba(34,197,94,.12);  color: #4ADE80; border: 1px solid rgba(34,197,94,.25); }
.alert-info    { background: rgba(59,130,246,.12); color: #93C5FD; border: 1px solid rgba(59,130,246,.25); }

/* ── PDF VIEWER ──────────────────────────────────────────────── */
.pdf-viewer { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: var(--radius); }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #F0F2F5; background-image: radial-gradient(ellipse at 20% 50%, rgba(204,31,38,.06) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(204,31,38,.04) 0%, transparent 50%); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem 2rem; width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 2rem; text-align: center; }
.login-logo-bm  { font-size: 48px; font-weight: 900; color: #CC1F26; letter-spacing: -.02em; line-height: 1; }
.login-logo-bm span { color: #CC1F26; }
.login-logo-sub { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .22em; margin-top: 2px; }
.login-logo-line { width: 40px; height: 2px; background: var(--orange); border-radius: 2px; margin: 8px auto 0; }

/* ── UTILS ───────────────────────────────────────────────────── */
.flex         { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.text-center { text-align: center; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-hint); }
