/* ============================================================
   युवा संमेलन — Examination Platform
   Design system on top of Bootstrap 5
   ============================================================ */

:root {
  --ink: #16213e;
  --ink-soft: #3d4763;
  --muted: #6b7280;
  --bg: #f7f8fc;
  --card: #ffffff;
  --line: #e7eaf3;

  --accent: #e8590c;
  --accent-deep: #c2255c;
  --accent-ink: #b34700;
  --accent-soft: #fff1e7;
  --accent-grad: linear-gradient(135deg, #f0620f 0%, #d63384 100%);

  --ok: #0d9464;
  --ok-soft: #e5f6ef;
  --warn: #c2410c;
  --warn-soft: #fff2e8;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(22, 33, 62, .05);
  --shadow-md: 0 1px 2px rgba(22, 33, 62, .05), 0 10px 30px -12px rgba(22, 33, 62, .16);
  --shadow-lg: 0 2px 6px rgba(22, 33, 62, .05), 0 24px 60px -20px rgba(22, 33, 62, .25);

  --t-fast: 160ms cubic-bezier(.4, 0, .2, 1);
  --t-med: 240ms cubic-bezier(.4, 0, .2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: "Mukta", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, .display-hero { color: var(--ink); font-weight: 700; }

.text-muted-2 { color: var(--muted); }
.fw-med { font-weight: 500; }

/* ---------- Top navigation ---------- */
.ys-nav {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(231, 234, 243, .9);
}
.ys-brand {
  font-weight: 800; font-size: 1.15rem; letter-spacing: .01em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: .55rem;
}
.ys-brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-grad);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; box-shadow: var(--shadow-sm);
}
.ys-nav .nav-link { color: var(--ink-soft); font-weight: 500; border-radius: 8px; padding: .4rem .8rem; transition: color var(--t-fast), background var(--t-fast); }
.ys-nav .nav-link:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast), opacity var(--t-fast); }
.btn:active { transform: translateY(1px); }

.btn-accent {
  background: var(--accent-grad); color: #fff; border: 0;
  padding: .65rem 1.4rem;
  box-shadow: 0 6px 18px -6px rgba(214, 51, 132, .5);
}
.btn-accent:hover, .btn-accent:focus { color: #fff; filter: brightness(1.05); box-shadow: 0 10px 24px -8px rgba(214, 51, 132, .55); transform: translateY(-1px); }
.btn-accent:disabled { background: #cbd0dd; box-shadow: none; color: #fff; }

.btn-soft {
  background: #fff; border: 1.5px solid var(--line); color: var(--ink-soft);
  padding: .6rem 1.2rem;
}
.btn-soft:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-quiet { background: transparent; border: 0; color: var(--muted); font-weight: 500; }
.btn-quiet:hover { color: var(--warn); background: var(--warn-soft); }

.btn-lg { padding: .8rem 1.8rem; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.ys-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.ys-card-hover { transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med); }
.ys-card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #dde2ef; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(214, 51, 132, .08), transparent 60%),
    radial-gradient(900px 480px at 0% 0%, rgba(240, 98, 15, .09), transparent 55%),
    linear-gradient(180deg, #fffdfb 0%, var(--bg) 100%);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem 1rem; font-weight: 600; font-size: .85rem; color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.display-hero {
  font-weight: 800; letter-spacing: -.01em;
  font-size: clamp(2.5rem, 7vw, 4.2rem); line-height: 1.15;
}
.display-hero .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 1.1rem; color: var(--ink-soft); max-width: 42rem; }

.stat-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; text-align: center; box-shadow: var(--shadow-sm);
}
.stat-tile .num { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-tile .lbl { font-size: .82rem; color: var(--muted); font-weight: 500; }

/* section chips on landing */
.sec-chip {
  display: flex; align-items: center; gap: .75rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: .8rem 1rem; height: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.sec-chip:hover { border-color: #e9c9b4; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.sec-chip .n {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.sec-chip .t { font-weight: 600; font-size: .92rem; color: var(--ink-soft); line-height: 1.35; }
.sec-chip .c { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ---------- Step indicator ---------- */
.steps { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; font-weight: 600; color: var(--muted);
  padding: .3rem .8rem; border-radius: 999px; background: #eef0f7;
}
.step.active { background: var(--accent-soft); color: var(--accent-ink); }
.step.done { background: var(--ok-soft); color: var(--ok); }
.step-sep { color: #c6cbdb; font-size: .7rem; }

/* ---------- Badges ---------- */
.badge-sec {
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; font-size: .78rem; border-radius: 999px; padding: .38em .9em;
  letter-spacing: .01em;
}
.badge-marks { background: #eef0f7; color: var(--ink-soft); font-weight: 600; font-size: .78rem; border-radius: 999px; padding: .38em .9em; }

/* ---------- Progress ---------- */
.ys-progress { height: 6px; border-radius: 999px; background: #e9ecf5; overflow: hidden; }
.ys-progress .bar { height: 100%; border-radius: 999px; background: var(--accent-grad); transition: width var(--t-med); }

/* ---------- Quiz: options ---------- */
.opt {
  position: relative; display: flex; align-items: flex-start; gap: .9rem;
  width: 100%; text-align: start; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: .95rem 1.1rem; margin-bottom: .7rem;
  font-size: 1.02rem; color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.opt:hover { border-color: #f2b28a; box-shadow: var(--shadow-sm); }
.opt:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(240, 98, 15, .18); }
.opt .key {
  flex: 0 0 auto; width: 30px; height: 30px; margin-top: .05rem;
  border-radius: 50%; border: 1.5px solid #d4d9e6;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--muted);
  transition: all var(--t-fast);
}
.opt .txt { padding-top: .15rem; line-height: 1.5; }
.opt.selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(240, 98, 15, .1);
}
.opt.selected .key { background: var(--accent-grad); border-color: transparent; color: #fff; }

/* question card animation */
.q-anim { animation: fadeUp .32s cubic-bezier(.3, .7, .3, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.q-text { font-size: 1.18rem; font-weight: 600; line-height: 1.6; color: var(--ink); }

/* ---------- Question palette ---------- */
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.pal {
  aspect-ratio: 1; min-width: 0; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #f3f4f9; color: var(--muted);
  font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.pal:hover { border-color: var(--accent); color: var(--accent-ink); }
.pal.answered { background: var(--ok-soft); border-color: #bfe7d6; color: var(--ok); }
.pal.skipped { background: var(--warn-soft); border-color: #f6d3b8; color: var(--warn); }
.pal.current { box-shadow: 0 0 0 3px rgba(240, 98, 15, .25); border-color: var(--accent); background: #fff; color: var(--accent-ink); }

/* section-grouped palette */
.palette-host { display: block; }
.pal-sec + .pal-sec { margin-top: .9rem; }
.pal-sec-head {
  display: flex; align-items: baseline; gap: .4rem;
  margin-bottom: .4rem; padding-bottom: .3rem;
  border-bottom: 1px dashed var(--line);
}
.pal-sec-head .lbl { font-size: .74rem; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.pal-sec-head .nm {
  font-size: .74rem; color: var(--muted); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0;
}
.pal-sec-head .ct {
  font-size: .68rem; font-weight: 600; color: var(--muted);
  background: #f3f4f9; border-radius: 999px; padding: .1em .5em; flex: 0 0 auto;
}

.legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .78rem; color: var(--muted); }
.legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: .35rem; vertical-align: -1px; border: 1px solid transparent; }
.dot-current { background: #fff; border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(240, 98, 15, .25); }
.dot-answered { background: var(--ok-soft); border-color: #bfe7d6 !important; }
.dot-skipped { background: var(--warn-soft); border-color: #f6d3b8 !important; }
.dot-unvisited { background: #f3f4f9; border-color: var(--line) !important; }

/* sticky sidebar on desktop */
.quiz-side { position: sticky; top: 86px; }

/* mobile bottom bar */
.quiz-bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: .65rem .9rem calc(.65rem + env(safe-area-inset-bottom));
}
.offcanvas-bottom.palette-sheet { height: auto; max-height: 72vh; border-radius: 20px 20px 0 0; }

/* ---------- Essay ---------- */
.essay-area {
  width: 100%; min-height: 46vh; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem; font-size: 1.08rem; line-height: 1.9; color: var(--ink);
  background: #fff; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.essay-area:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(240, 98, 15, .14); }
.save-pill { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; transition: color var(--t-fast); }
.save-pill.saved { color: var(--ok); }

/* ---------- Review / summary ---------- */
.sum-tile { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; background: #fff; height: 100%; }
.sum-tile .big { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.chip-q {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 34px; padding: 0 .5rem; margin: .18rem;
  border-radius: 9px; background: var(--warn-soft); color: var(--warn);
  font-weight: 700; font-size: .88rem; border: 1px solid #f6d3b8; cursor: pointer;
  transition: all var(--t-fast);
}
.chip-q:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ---------- Success ---------- */
.success-ring {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 3rem; animation: pop .5s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sub-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; color: var(--ink);
  background: #f3f4f9; border: 1px dashed #cdd3e1; border-radius: 12px; padding: .7rem 1.4rem;
}

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .9rem; color: var(--ink-soft); margin-bottom: .35rem; }
.form-label .req { color: var(--accent); }

.form-control, .form-select {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .9rem; font-size: 1rem; color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(240, 98, 15, .14); outline: none;
}
.form-control::placeholder { color: #a8b0c2; }
.form-control.is-invalid, .form-select.is-invalid {
  border-color: #dc3545; box-shadow: none; background-image: none;
}
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 53, 69, .12); }
.invalid-feedback { font-size: .82rem; font-weight: 500; }

/* input with a fixed prefix, e.g. +91 */
.input-prefix {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(240, 98, 15, .14); }
.input-prefix.is-invalid { border-color: #dc3545; }
.input-prefix .pfx {
  display: inline-flex; align-items: center; padding: 0 .85rem;
  background: #f3f4f9; color: var(--muted); font-weight: 600; font-size: .95rem;
  border-right: 1.5px solid var(--line);
}
.input-prefix .form-control { border: 0 !important; box-shadow: none !important; border-radius: 0; }
.input-prefix .form-control:focus { box-shadow: none !important; }
.pw-toggle {
  border: 0; background: transparent; color: var(--muted);
  padding: 0 .9rem; cursor: pointer; transition: color var(--t-fast);
}
.pw-toggle:hover { color: var(--accent); }

.radio-pills { display: flex; gap: .5rem; flex-wrap: wrap; }
.radio-pills input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pills label {
  border: 1.5px solid var(--line); border-radius: 999px; padding: .45rem 1.1rem;
  font-weight: 500; font-size: .93rem; color: var(--ink-soft); cursor: pointer;
  transition: all var(--t-fast); background: #fff;
}
.radio-pills input:checked + label {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600;
}
.radio-pills input:focus-visible + label { box-shadow: 0 0 0 4px rgba(240, 98, 15, .18); }

/* ---------- Auth screens ---------- */
.auth-shell { min-height: calc(100vh - 61px); display: flex; align-items: center; }
.auth-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--line); background: #fff; }
.auth-aside {
  background:
    radial-gradient(700px 380px at 20% 0%, rgba(255, 255, 255, .18), transparent 60%),
    var(--accent-grad);
  color: #fff; padding: 2.5rem 2.25rem;
}
.auth-aside h3 { color: #fff; font-weight: 800; }
.auth-aside .lead-sm { color: rgba(255, 255, 255, .92); font-size: .98rem; line-height: 1.7; }
.auth-aside .pt { display: flex; gap: .65rem; align-items: flex-start; color: rgba(255, 255, 255, .95); font-size: .93rem; padding: .3rem 0; }
.auth-aside .pt i { margin-top: .2rem; }
.auth-body { padding: 2.25rem 2rem; }

.alert-soft {
  border-radius: var(--radius-md); border: 1px solid; padding: .85rem 1rem;
  font-size: .92rem; font-weight: 500; display: flex; gap: .6rem; align-items: flex-start;
}
.alert-soft i { margin-top: .1rem; flex: 0 0 auto; }
.alert-err { background: #fdf0f1; border-color: #f3c9ce; color: #b02a37; }
.alert-ok { background: var(--ok-soft); border-color: #bfe7d6; color: var(--ok); }
.alert-warn { background: var(--warn-soft); border-color: #f6d3b8; color: var(--warn); }
.alert-info { background: #eef2fb; border-color: #d7e0f3; color: #3a4a72; }

/* ---------- Candidate chip in the header ---------- */
.cand-chip {
  display: inline-flex; align-items: center; gap: .55rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: .28rem .6rem .28rem .3rem; cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.cand-chip:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.cand-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .88rem;
}
.cand-chip .meta { flex-direction: column; line-height: 1.15; text-align: start; }
.cand-chip .meta .nm { font-weight: 600; font-size: .84rem; color: var(--ink); white-space: nowrap; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.cand-chip .meta .mb { font-size: .74rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cand-menu { border-radius: var(--radius-md); border: 1px solid var(--line); box-shadow: var(--shadow-md); padding: .35rem; min-width: 15rem; }
.cand-menu .dropdown-item { border-radius: 8px; font-weight: 500; font-size: .92rem; padding: .5rem .75rem; }

/* ---------- Status cards (resume / already submitted) ---------- */
.state-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 2rem;
}
.state-icon.warn { background: var(--warn-soft); color: var(--warn); }
.state-icon.ok { background: var(--ok-soft); color: var(--ok); }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-weight: 500; }
.kv .v { color: var(--ink); font-weight: 600; text-align: end; }

/* ---------- Admin roster ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: auto; background: #fff; }
.ys-table { width: 100%; margin: 0; font-size: .9rem; border-collapse: separate; border-spacing: 0; }
.ys-table th {
  background: #f7f8fc; color: var(--ink-soft); font-weight: 600; font-size: .82rem;
  text-align: start; padding: .75rem .9rem; white-space: nowrap; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.ys-table td { padding: .7rem .9rem; border-bottom: 1px solid #f0f2f8; color: var(--ink); vertical-align: middle; }
.ys-table tbody tr:last-child td { border-bottom: 0; }
.ys-table tbody tr:hover { background: #fafbff; }
.pill { display: inline-block; padding: .22em .7em; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-idle { background: #eef0f7; color: var(--muted); }

/* ---------- Instruction list ---------- */
.ins-list { list-style: none; padding: 0; margin: 0; }
.ins-list li { display: flex; gap: .8rem; padding: .55rem 0; color: var(--ink-soft); line-height: 1.6; }
.ins-list li i { color: var(--accent); margin-top: .25rem; flex: 0 0 auto; }

/* ---------- Footer ---------- */
.ys-footer { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); background: #fff; }

/* ---------- Responsive tuning ---------- */
@media (max-width: 991.98px) {
  .quiz-side { position: static; }
  body.quiz-page { padding-bottom: 84px; }  /* room for fixed bottom bar */
}
@media (max-width: 575.98px) {
  .q-text { font-size: 1.08rem; }
  .opt { padding: .85rem .9rem; font-size: .98rem; }
  .btn-lg { padding: .75rem 1.3rem; font-size: 1rem; }
  .palette-grid { grid-template-columns: repeat(6, 1fr); }
  .display-hero { font-size: clamp(2.1rem, 9vw, 2.9rem); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
