/*
 * Job Radar app chrome.
 *
 * Everything here sits on the no word of lie. design system tokens loaded from
 * assets/ds/. The CV documents themselves carry their own inline styles, lifted
 * from the design references — this file styles only the app around them.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--surface-page);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: Quicksand, "Trebuchet MS", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color 160ms var(--ease-brand, cubic-bezier(0.2, 0.8, 0.2, 1));
}

a:hover {
  color: var(--teal-300);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-md, 16px);
}

/* --- the teal full stop, as punctuation ---------------------------------- */

.stop {
  color: var(--text-accent);
}

/* --- layout --------------------------------------------------------------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--line-hairline);
  background: var(--surface-raised);
}

.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-heading);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.site-nav a:hover {
  background: var(--surface-hover);
  color: var(--text-heading);
}

.site-nav a[aria-current="page"] {
  background: var(--surface-accent);
  color: var(--text-on-accent);
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 56px) 72px;
}

.site-footer {
  padding: 16px clamp(20px, 5vw, 56px);
  border-top: 1px solid var(--line-hairline);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- auth pages ----------------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-card);
  background-image: var(--sheen-card);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  padding: 36px 34px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.auth-card .lede {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.auth-alt {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-hairline);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- forms ---------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
}

.field .hint {
  font-size: 12px;
  color: var(--text-muted);
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md, 16px);
  color: var(--text-body);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 160ms var(--ease-brand, cubic-bezier(0.2, 0.8, 0.2, 1));
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--line-accent);
  box-shadow: var(--focus-ring);
}

input[readonly] {
  color: var(--text-muted);
  background: var(--surface-raised);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-400);
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 160ms var(--ease-brand, cubic-bezier(0.2, 0.8, 0.2, 1)),
    transform 90ms var(--ease-brand, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--surface-accent);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: var(--teal-300);
  box-shadow: var(--glow-teal, 0 0 24px rgba(18, 203, 196, 0.35));
}

.btn-secondary {
  background: transparent;
  border-color: var(--line-soft);
  color: var(--text-body);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.38;
  pointer-events: none;
}

/* --- messages ------------------------------------------------------------- */

.flash {
  padding: 13px 16px;
  border-radius: var(--radius-md, 16px);
  font-size: 14px;
  margin-bottom: 22px;
  border: 1px solid var(--line-soft);
  background: var(--surface-inset);
}

.flash-success {
  border-color: rgba(61, 220, 132, 0.4);
  color: var(--signal-positive);
}

.flash-error {
  border-color: rgba(255, 95, 86, 0.4);
  color: var(--signal-critical);
}

.problems {
  margin: 0 0 20px;
  padding: 13px 16px 13px 32px;
  border: 1px solid rgba(255, 95, 86, 0.4);
  border-radius: var(--radius-md, 16px);
  background: var(--surface-inset);
  color: var(--signal-critical);
  font-size: 13px;
}

.problems li + li {
  margin-top: 5px;
}

/* --- empty state ---------------------------------------------------------- */

.empty {
  background: var(--surface-card);
  background-image: var(--sheen-card);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  padding: 44px 40px;
  text-align: center;
}

.empty h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
}

.empty p {
  margin: 0 auto;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 14px;
}

.page-title {
  margin: 0 0 4px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-heading);
}

.page-lede {
  margin: 0 0 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* --- dashboard ------------------------------------------------------------ */

.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.date-jump {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.date-jump select {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.job-card {
  display: flex;
  gap: 24px;
  align-items: stretch;
  background: var(--surface-card);
  background-image: var(--sheen-card);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  padding: 22px 26px;
  margin-bottom: 16px;
  transition: transform 160ms var(--ease-brand, cubic-bezier(0.2, 0.8, 0.2, 1)),
              border-color 160ms var(--ease-brand, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.job-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-soft);
}

.job-card-flagged {
  background: var(--surface-accent-soft);
  border-color: rgba(18, 203, 196, 0.3);
  background-image: none;
}

.job-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.job-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-heading);
}

.job-title a {
  color: inherit;
}

.job-title a:hover {
  color: var(--text-accent);
}

.score {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(18, 203, 196, 0.3);
  background: var(--surface-accent-soft);
}

.score-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-accent);
  line-height: 1;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--text-body);
}

.job-meta .muted {
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.badge-accent {
  background: var(--surface-accent);
  color: var(--text-on-accent);
}

.badge-plain {
  border: 1px solid var(--line-soft);
  color: var(--text-muted);
}

.reasons {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.reasons li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 10px;
  border: 1px solid var(--line-hairline);
  border-radius: 999px;
}

.notice {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.notice code,
.empty code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--text-body);
}

.job-actions {
  flex: 0 0 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding-left: 24px;
  border-left: 1px solid var(--line-hairline);
}

.btn-small {
  padding: 7px 14px;
  font-size: 12.5px;
}

.cv-state {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: lowercase;
}

.cv-state-approved {
  color: var(--signal-positive);
}

.cv-state-rejected {
  color: var(--signal-critical);
}

.verdicts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: flex-end;
}

.verdicts form {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.verdicts .btn {
  width: 100%;
  justify-content: center;
}

.needs-call {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--line-hairline);
}

.section-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.section-lede {
  margin: 0 0 22px;
  max-width: 68ch;
  font-size: 13.5px;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .job-card {
    flex-direction: column;
  }

  .job-actions {
    flex-direction: row;
    align-items: center;
    flex-basis: auto;
    padding-left: 0;
    padding-top: 16px;
    border-left: none;
    border-top: 1px solid var(--line-hairline);
  }

  .verdicts {
    flex-direction: row;
    width: auto;
  }
}

/* --- CV editor ------------------------------------------------------------ */

.ed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.ed-breadcrumb {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.ed-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ed-layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 24px;
  align-items: start;
}

.ed-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding-right: 6px;
}

.ed-group {
  background: var(--surface-card);
  background-image: var(--sheen-card);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  padding: 4px 22px 4px;
}

.ed-group[open] {
  padding-bottom: 20px;
}

.ed-group > summary {
  cursor: pointer;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  list-style: none;
}

.ed-group > summary::-webkit-details-marker {
  display: none;
}

.ed-group > summary::before {
  content: "＋";
  display: inline-block;
  width: 18px;
  color: var(--text-accent);
}

.ed-group[open] > summary::before {
  content: "－";
}

.ed-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.ed-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
}

.ed-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.ed-field input,
.ed-field textarea {
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 12px;
  resize: vertical;
}

.ed-over .ed-count {
  color: var(--signal-caution);
}

.ed-over input,
.ed-over textarea {
  border-color: rgba(255, 200, 87, 0.5);
}

.ed-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
}

.ed-tile,
.ed-role {
  padding: 14px 0;
  border-top: 1px solid var(--line-hairline);
}

.ed-tile:first-of-type,
.ed-role:first-of-type {
  border-top: none;
}

.ed-role h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-accent);
}

.ed-hint {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-faint);
}

.ed-swap {
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text-accent);
  font-family: inherit;
  font-size: 11px;
  padding: 2px 9px;
  cursor: pointer;
  margin-right: 4px;
}

.ed-swap:hover {
  background: var(--surface-hover);
}

.ed-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 8px;
}

.ed-preview {
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  overflow: hidden;
  background: var(--surface-raised);
  position: sticky;
  top: 20px;
}

.ed-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-hairline);
  font-size: 12px;
  color: var(--text-muted);
}

.ed-preview iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 130px);
  border: 0;
  background: #000;
}

.ed-decide {
  margin-top: 32px;
  background: var(--surface-card);
  background-image: var(--sheen-card);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  padding: 24px 26px;
}

.ed-decide h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
}

.ed-rating {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0 14px;
  font-size: 13px;
  color: var(--text-body);
}

.ed-rating label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ed-rating input {
  accent-color: var(--teal-400);
}

.ed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.ed-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.ed-tag input {
  accent-color: var(--teal-400);
}

.ed-decide textarea {
  font-size: 13px;
  border-radius: 12px;
}

.ed-decide-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 1080px) {
  .ed-layout {
    grid-template-columns: 1fr;
  }

  .ed-form,
  .ed-preview {
    position: static;
    max-height: none;
  }

  .ed-preview iframe {
    height: 80vh;
  }
}

/* --- insights ------------------------------------------------------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-tile {
  background: var(--surface-accent-soft);
  border: 1px solid rgba(18, 203, 196, 0.3);
  border-radius: var(--radius-card, 24px);
  padding: 20px 22px;
}

.stat-figure {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-heading);
}

.stat-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.insight-card {
  background: var(--surface-card);
  background-image: var(--sheen-card);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-card, 24px);
  padding: 22px 26px;
}

.insight-wide {
  grid-column: 1 / -1;
}

.insight-card h2 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-accent);
}

.weights {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.weights li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-hairline);
  font-size: 13px;
}

.weights li:first-child {
  border-top: none;
}

.weight-key {
  flex: 1;
  min-width: 0;
  color: var(--text-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-dir {
  font-size: 12px;
  white-space: nowrap;
}

.weight-up {
  color: var(--signal-positive);
}

.weight-down {
  color: var(--signal-caution);
}

.weight-obs {
  font-size: 11px;
  color: var(--text-faint);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 6px;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.data-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line-hairline);
  color: var(--text-body);
}

.data-table tr:last-child td {
  border-bottom: none;
}
