/* ───────────────────────── Tokens ───────────────────────── */

:root {
  --font-display: 'Sora', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;

  --bg-0: #05080f;
  --bg-1: #080c16;
  --surface: #0b111e;
  --surface-2: #151b28;
  --surface-hover: #1b2232;
  --border: #20283c;
  --border-strong: #2c3650;

  --text: #ffffff;
  --text-dim: #a6a6a6;
  --text-faint: #6e7485;

  --accent: #e4a001;
  --accent-2: #ff9500;
  --accent-ink: #05080f;
  --accent-dim: rgba(228, 160, 1, 0.14);
  --accent-border: rgba(228, 160, 1, 0.35);

  --success: #36d399;
  --success-dim: rgba(54, 211, 153, 0.14);
  --danger: #ef4343;
  --danger-dim: rgba(239, 67, 67, 0.14);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-md: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  --shadow-card: 0 20px 60px -10px rgba(2, 3, 6, 0.6);
  --shadow-glow: 0 0 30px rgba(228, 160, 1, 0.10), 0 0 60px rgba(228, 160, 1, 0.06);
  --shadow-gold: 0 0 25px rgba(228, 160, 1, 0.16), 0 0 50px rgba(228, 160, 1, 0.08);
}

/* ───────────────────────── Reset & base ───────────────────────── */

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(228, 160, 1, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 149, 0, 0.08), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-dim); color: var(--accent-2); }

/* ───────────────────────── Navbar ───────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text);
}

.navbar .brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.95rem;
}

.navbar .brand span { color: var(--accent-2); }

.navbar nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar nav a.nav-link {
  color: var(--text-dim);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.navbar nav a.nav-link:hover { background: var(--surface-2); color: var(--text); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.user-chip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-chip .name { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.user-chip button.link-btn {
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  font-size: 0.78rem; padding: 0; font-family: inherit;
}
.user-chip button.link-btn:hover { color: var(--danger); }

/* ───────────────────────── Layout ───────────────────────── */

.container {
  max-width: 620px;
  margin: 56px auto;
  padding: 0 20px;
}
.container.wide { max-width: 960px; }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card h1 {
  margin-top: 0;
  font-size: 1.6rem;
}
.card h2 { font-size: 1.15rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.subtitle { color: var(--text-dim); margin-top: -6px; margin-bottom: 26px; line-height: 1.5; }

/* ───────────────────────── Forms ───────────────────────── */

label { display: block; margin: 16px 0 7px; font-size: 0.82rem; font-weight: 600; color: var(--text-dim); }

input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-hover);
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a4abba' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.hint { font-size: 0.79rem; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }

/* ───────────────────────── Buttons ───────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  box-shadow: 0 10px 28px -12px rgba(228, 160, 1, 0.45);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.btn:hover { filter: brightness(1.07); box-shadow: 0 10px 28px -12px rgba(228, 160, 1, 0.45), var(--shadow-gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; filter: none; }

.btn.block { display: flex; width: 100%; }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 10px 28px -12px rgba(239, 98, 89, 0.55); }
.btn.sm { margin-top: 0; padding: 8px 16px; font-size: 0.83rem; }

/* ───────────────────────── Alerts ───────────────────────── */

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.alert.error { background: var(--danger-dim); border: 1px solid rgba(239, 98, 89, 0.4); color: #ffb4ae; }
.alert.info { background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent-2); }
.alert.success { background: var(--success-dim); border: 1px solid rgba(79, 209, 139, 0.4); color: #93ecbe; }

/* ───────────────────────── Badges ───────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.pending { background: var(--accent-dim); color: var(--accent-2); }
.status-badge.rejected { background: var(--danger-dim); color: #ff9a90; }
.status-badge.approved { background: var(--success-dim); color: #7fe0a0; }

/* ───────────────────────── Stepper ───────────────────────── */

.stepper {
  display: flex;
  align-items: center;
  margin: 4px 0 32px;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.step .bubble {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  color: var(--text-faint);
  background: var(--surface-2);
  transition: all 0.2s ease;
}
.step .label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-faint);
  display: none;
  white-space: nowrap;
}
.step.done .bubble { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent-2); }
.step.current .bubble { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
.step.done .label, .step.current .label { color: var(--text); }
.connector { flex: 1; height: 2px; background: var(--border); margin: 0 10px; min-width: 14px; }
.connector.done { background: var(--accent-border); }

@media (min-width: 640px) {
  .step .label { display: inline; }
}

/* ───────────────────────── Auth split screen ───────────────────────── */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
}

.auth-panel {
  display: none;
  position: relative;
  padding: 60px;
  background:
    radial-gradient(700px 500px at 20% 10%, rgba(228, 160, 1, 0.14), transparent 60%),
    linear-gradient(160deg, #14161d, #08090c);
  border-right: 1px solid var(--border);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

@media (min-width: 900px) { .auth-panel { display: flex; } }

.auth-panel .mark-lg {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 800; font-family: var(--font-display); font-size: 1.3rem;
}

.auth-panel h2 {
  font-size: 2rem;
  max-width: 380px;
  margin: 40px 0 14px;
  line-height: 1.2;
}
.auth-panel p { color: var(--text-dim); max-width: 360px; line-height: 1.6; }

.auth-panel .feature-list { margin-top: 36px; display: flex; flex-direction: column; gap: 18px; }
.auth-panel .feature {
  display: flex; gap: 12px; align-items: flex-start; color: var(--text-dim); font-size: 0.88rem; line-height: 1.5;
}
.auth-panel .feature .dot {
  margin-top: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.auth-panel .foot { color: var(--text-faint); font-size: 0.78rem; }

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-form-wrap .inner { width: 100%; max-width: 400px; }
.auth-form-wrap .mobile-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-family: var(--font-display); font-weight: 700;
}
@media (min-width: 900px) { .auth-form-wrap .mobile-brand { display: none; } }

/* ───────────────────────── Question blocks ───────────────────────── */

.progress-track {
  height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 28px;
}
.progress-track .fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px;
}

.question-block {
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}
.question-block:first-child { padding-top: 0; }
.question-block:last-child { border-bottom: none; padding-bottom: 4px; }
.question-block p.q-text { font-weight: 600; margin: 0 0 14px; font-size: 0.96rem; line-height: 1.5; }
.q-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent-dim); color: var(--accent-2);
  font-size: 0.72rem; font-weight: 800; margin-right: 8px;
}

.option-grid { display: grid; gap: 8px; }
.option-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option-pill:hover { border-color: var(--border-strong); }
.option-pill input { position: absolute; opacity: 0; }
.option-pill .dot {
  width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--border-strong);
  flex-shrink: 0; position: relative; transition: border-color 0.15s ease;
}
.option-pill input:checked ~ .dot { border-color: var(--accent); }
.option-pill input:checked ~ .dot::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}
.option-pill:has(input:checked) { border-color: var(--accent-border); background: var(--accent-dim); }
.option-pill .opt-text { font-size: 0.9rem; color: var(--text); }

/* ───────────────────────── Status / result tiles ───────────────────────── */

.result-tile {
  display: flex; align-items: center; gap: 20px;
  padding: 26px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2);
  margin-bottom: 22px;
}
.result-tile .score {
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700;
  min-width: 92px; text-align: center;
}
.result-tile.pass .score { color: var(--success); }
.result-tile.fail .score { color: var(--danger); }
.result-tile .meta { color: var(--text-dim); font-size: 0.86rem; line-height: 1.5; }
.result-tile .meta strong { color: var(--text); }

.state-card {
  display: flex; gap: 18px; align-items: flex-start;
}
.state-card .icon {
  width: 46px; height: 46px; min-width: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent-2);
}
.state-card .icon.success { background: var(--success-dim); color: #7fe0a0; }
.state-card .icon.danger { background: var(--danger-dim); color: #ff9a90; }

/* ───────────────────────── Tables ───────────────────────── */

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 0.87rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
th { color: var(--text-faint); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface); }

/* ───────────────────────── Misc ───────────────────────── */

.muted { color: var(--text-dim); }
.small { font-size: 0.85rem; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

.divider { height: 1px; background: var(--border); margin: 26px 0; }

.site-footer {
  text-align: center; padding: 40px 0 30px; color: var(--text-faint); font-size: 0.78rem;
}

/* ───────────────────────── Insignia de rango (navbar) ───────────────────────── */

.role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 2px;
}

/* ───────────────────────── Panel de Admin ───────────────────────── */

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  width: fit-content;
}
.admin-tab {
  padding: 9px 16px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.admin-tab:hover { color: var(--text); text-decoration: none; }
.admin-tab.active { background: var(--border); color: var(--text); }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
