/* ============================================================
   Internships — visual system

   One accent hue (green) carries every interactive and data
   mark. The Statistics bars are a single-series magnitude
   chart, so they use one hue at varying emphasis rather than a
   categorical palette — which sidesteps colorblind-adjacency
   problems entirely instead of trying to pass them.

   Dark mode is chosen, not flipped: its surfaces sit slightly
   warm, and the accent lifts in lightness so it still reads
   against a dark ground.
   ============================================================ */

:root {
  /* surfaces, warm neutral */
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-sunken: #f1efea;
  --border: #e4e1da;
  --border-strong: #d3cfc5;

  /* ink */
  --text: #1e1c19;
  --text-secondary: #6b665d;
  --text-muted: #918b80;

  /* accent */
  --accent: #2e6b4f;
  --accent-hover: #245740;
  --accent-soft: #e7f0ea;
  --accent-ring: rgba(46, 107, 79, .28);
  /* Ink that sits ON the accent. White works on the dark-green light-mode
     accent; the dark-mode accent is far lighter, so white would drop to
     2.5:1 there. This token is what keeps both modes legible. */
  --on-accent: #ffffff;

  /* status */
  --warn-bg: #fbf0d8;
  --warn-text: #8a6116;
  --danger: #a53d2c;          /* danger as TEXT, on a page background */
  --danger-solid: #a53d2c;    /* danger as a FILL, with white text on it */
  --danger-soft: #fbe9e5;

  /* data marks */
  --bar-track: #eceae4;
  --bar-fill: #2e6b4f;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 20, .05);
  --shadow: 0 1px 2px rgba(28, 25, 20, .04), 0 6px 20px rgba(28, 25, 20, .06);
  --shadow-lg: 0 4px 12px rgba(28, 25, 20, .08), 0 20px 48px rgba(28, 25, 20, .14);

  --ease: cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --surface: #1d1f24;
    --surface-sunken: #191b1f;
    --border: #2e3138;
    --border-strong: #3d414a;

    --text: #eae7e1;
    --text-secondary: #9d978c;
    --text-muted: #7b756a;

    --accent: #64b287;
    --accent-hover: #7cc39b;
    --accent-soft: #1e3128;
    --accent-ring: rgba(100, 178, 135, .32);
    --on-accent: #10201a;     /* 6.6:1 on the light-mode-lifted accent */

    --warn-bg: #382e19;
    --warn-text: #dcb367;
    --danger: #dd8171;        /* lifted so it reads as text on a dark page */
    --danger-solid: #b8442f;  /* deepened so white text on it stays 5.4:1 */
    --danger-soft: #35211d;

    --bar-track: #26292f;
    --bar-fill: #64b287;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .28);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 20px 48px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  height: 60px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}

.tabs { display: flex; gap: 2px; }

/* An underline indicator reads quieter than a filled pill and keeps the
   bar from looking like four competing buttons. */
.tab-btn {
  position: relative;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}

.tab-btn::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .18s var(--ease);
}

.tab-btn:hover { color: var(--text); background: var(--surface-sunken); }
.tab-btn.active { color: var(--text); font-weight: 550; background: none; }
.tab-btn.active::after { transform: scaleX(1); }

.badge {
  display: inline-block;
  margin-left: 7px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--danger-solid);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}

/* ---------- layout ---------- */

main { max-width: 940px; margin: 0 auto; padding: 36px 24px 80px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise .22s var(--ease); }

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.muted { color: var(--text-secondary); }

/* ---------- apply deck ---------- */

.deck-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}

.deck-position {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  min-width: 62px;
  text-align: center;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}

.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn:active:not(:disabled) { transform: translateY(1px); }
.icon-btn:disabled { opacity: .3; cursor: default; box-shadow: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
}

.card-header h2 {
  margin: 0 0 5px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.card-header p { margin: 0; font-size: 13px; }

.status-pill {
  flex-shrink: 0;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-new { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status-drafted { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.status-submitted { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.status-skipped { opacity: .65; }

.loading {
  padding: 56px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.field-group { margin-bottom: 24px; }

.field-group label,
.stats-section h3 {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

textarea, select, input[type="password"], input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

textarea:hover, select:hover { border-color: var(--border-strong); }

textarea:focus, select:focus,
input[type="password"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.readonly-block {
  max-height: 280px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.action-btns { display: flex; gap: 10px; }

.link-btn {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s var(--ease);
}
.link-btn:hover { color: var(--accent); }

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .1s var(--ease);
}

.btn:active:not(:disabled) { transform: translateY(1px); }

.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn.secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.btn.secondary:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }

.btn:disabled { opacity: .4; cursor: default; box-shadow: none; }

.empty-state { padding: 96px 24px; text-align: center; color: var(--text-secondary); }
.empty-state h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.empty-state p { margin: 0 auto; max-width: 400px; font-size: 14px; }

/* ---------- list ---------- */

.list-filters { margin-bottom: 18px; }
.list-filters select { width: auto; min-width: 190px; }

#list-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.listing-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.listing-table th {
  padding: 13px 18px;
  text-align: left;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.listing-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.listing-table tbody tr:last-child td { border-bottom: 0; }
.listing-table tbody tr { cursor: pointer; transition: background .12s var(--ease); }
.listing-table tbody tr:hover { background: var(--surface-sunken); }

/* Direct link to the employer's application form, on every List row. */
.row-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.row-link:hover { text-decoration: underline; }

/* ---------- stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* The hero number is the whole point of a stat tile — let it be big. */
.stat-card .value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stats-section { margin-bottom: 40px; }
.stats-section h3 { margin: 0 0 16px; }

.bar-list { display: flex; flex-direction: column; gap: 6px; }

.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 44px;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  padding: 3px 0;
  border-radius: 6px;
  transition: background .12s var(--ease);
}

.bar-row:hover { background: var(--surface-sunken); }

/* Labels and values wear text tokens, never the series color — the bar
   itself carries the identity. */
.bar-label {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recessive track, no border: the data is the fill, not the container. */
.bar-track {
  height: 10px;
  background: var(--bar-track);
  border-radius: 5px;
  overflow: hidden;
}

/* Rounded only on the data end, anchored flat to the baseline. */
.bar-fill {
  height: 100%;
  background: var(--bar-fill);
  min-width: 3px;
  border-radius: 0 4px 4px 0;
  transition: width .4s var(--ease), filter .12s var(--ease);
}

.bar-row:hover .bar-fill { filter: brightness(1.08); }

.bar-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 12, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fade .16s var(--ease);
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal[hidden] { display: none; }

.modal-content {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  animation: rise .2s var(--ease);
}

.modal-close { position: absolute; top: 16px; right: 16px; font-size: 20px; line-height: 1; }

/* ---------- application questions ---------- */

.questions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.questions-header label { margin-bottom: 0; }
.questions-actions { display: flex; gap: 6px; }

.btn.tiny {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
}

.btn.tiny.secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.btn.tiny:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.btn.tiny.secondary:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

.questions-status { font-size: 12px; margin-bottom: 12px; }

.question {
  padding: 16px;
  margin-bottom: 10px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s var(--ease);
}

.question:hover { border-color: var(--border-strong); }

.q-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.q-label { font-size: 13px; font-weight: 550; line-height: 1.5; }

.q-req {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--danger);
}

.q-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.q-tag {
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

.q-tag.subtle { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

.question .q-input { background: var(--surface); font-size: 13px; }
.question textarea.q-input { font-family: inherit; line-height: 1.6; }

.q-note { margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.q-note.warn { color: var(--warn-text); }

/* Self-identification questions are never AI-drafted — the dashed edge is
   the visual reminder that this one is yours to answer. */
.question.sensitive { border-style: dashed; background: transparent; }

/* ---------- answer bank ---------- */

.answers-intro { max-width: 640px; margin: 0 0 24px; font-size: 14px; }

.answer-card {
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease);
}

.answer-card:hover { border-color: var(--border-strong); }

.answer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.answer-q { font-size: 14px; font-weight: 550; line-height: 1.5; }
.answer-meta { font-size: 12px; margin: 5px 0 12px; color: var(--text-muted); }
.answer-text { background: var(--surface-sunken); font-family: inherit; font-size: 13px; }

/* ---------- "new postings arrived" pill ---------- */

.new-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  padding: 9px 17px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}

.new-pill[hidden] { display: none; }
.new-pill:hover { background: var(--accent); color: var(--on-accent); }
.new-pill:hover .new-pill-dot { background: var(--on-accent); }

.new-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger-solid);
  animation: pulse 2s ease-in-out infinite;
}

.new-pill-action { opacity: .7; text-decoration: underline; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ---------- login ---------- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 350px;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card h1 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.login-card p { margin: 0 0 22px; font-size: 13px; color: var(--text-secondary); }
.login-card input { margin-bottom: 12px; text-align: center; }
.login-card .btn { width: 100%; }
.login-error { color: var(--danger) !important; font-weight: 500; }

/* ---------- responsive ---------- */

@media (max-width: 700px) {
  .topbar { gap: 12px; padding: 0 14px; height: 56px; }
  .brand { display: none; }
  .tab-btn { padding: 8px 9px; font-size: 13px; }
  .tab-btn::after { left: 9px; right: 9px; }
  main { padding: 22px 14px 56px; }
  .card { padding: 20px; }
  .card-header h2 { font-size: 18px; }
  .card-actions { flex-direction: column-reverse; align-items: stretch; }
  .action-btns .btn { flex: 1; }
  .bar-row { grid-template-columns: 96px 1fr 36px; gap: 10px; }
  .modal-content { padding: 22px; }
  .stat-card .value { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
