/* ─────────────────────────────────────────────────────────────────────────────
   EasyJob — Job Post Quality Checker
   job-checker.css
   Builds on employer-dashboard.css design tokens. Do not duplicate base rules.
───────────────────────────────────────────────────────────────────────────── */

/* ── sidebar additions ───────────────────────────────────────────────────── */

.side-link__badge {
  margin-left: auto;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
}

.side-logout-btn {
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: .15s ease;
}
.side-logout-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ── topbar override for this page ──────────────────────────────────────── */

.topbar__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__page-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ai-badge {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  padding: 3px 8px;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #fff;
}

/* ── two-column layout ───────────────────────────────────────────────────── */

.checker-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 22px;
  align-items: start;
  min-height: calc(100vh - 54px);
}

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

/* ── panel base (reused from dashboard) ──────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.panel__head {
  margin-bottom: 20px;
}

.panel__title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.panel__subtitle {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── form ────────────────────────────────────────────────────────────────── */

.checker-form-panel {
  position: sticky;
  top: 22px;
}

.checker-form {
  display: grid;
  gap: 16px;
}

.checker-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .checker-form__grid { grid-template-columns: 1fr; }
}

.field-group {
  display: grid;
  gap: 6px;
}

.field-group label {
  font-size: .84rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-meta {
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}

.field-group input,
.field-group select,
.field-group textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  outline: none;
  background: #fafcff;
  color: var(--text);
  transition: border-color .15s ease;
  resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #b0bac8;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.checker-form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}

/* ── results column ──────────────────────────────────────────────────────── */

.checker-results-col {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* ── idle state ──────────────────────────────────────────────────────────── */

.results-idle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 52px 28px;
  text-align: center;
}

.results-idle__icon {
  font-size: 2.2rem;
  color: var(--primary-2);
  margin-bottom: 14px;
  display: block;
}

.results-idle__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.results-idle__sub {
  font-size: .9rem;
  color: var(--muted);
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── score card ──────────────────────────────────────────────────────────── */

.score-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.score-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.score-ring {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.score-ring__track {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 7;
}

.score-ring__fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 213.6; /* 2π × 34 */
  stroke-dashoffset: 213.6;
  transition: stroke-dashoffset .6s ease, stroke .4s ease;
}

.score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.score-ring__label strong {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

.score-ring__label span {
  font-size: .65rem;
  color: var(--muted);
  font-weight: 600;
}

.score-card__text {
  flex: 1;
}

.score-card__grade {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--text);
}

.score-card__note {
  font-size: .87rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* grade colour modifiers */
.grade--excellent .score-card__grade { color: #16a34a; }
.grade--good      .score-card__grade { color: #2563eb; }
.grade--fair      .score-card__grade { color: #d97706; }
.grade--poor      .score-card__grade { color: #dc2626; }

.grade--excellent .score-ring__fill  { stroke: #16a34a; }
.grade--good      .score-ring__fill  { stroke: #2563eb; }
.grade--fair      .score-ring__fill  { stroke: #d97706; }
.grade--poor      .score-ring__fill  { stroke: #dc2626; }

/* ── result sections ─────────────────────────────────────────────────────── */

.result-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.result-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.result-section__head h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  flex: 1;
}

.result-section__icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 900;
  flex-shrink: 0;
}

.result-section__icon--warn { background: #fef3c7; color: #b45309; }
.result-section__icon--info { background: #e0f2fe; color: #0369a1; }
.result-section__icon--tip  { background: #ede9fe; color: #7c3aed; }
.result-section__icon--good { background: #dcfce7; color: #15803d; }

.result-count {
  background: var(--surface-2);
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.result-list li {
  font-size: .875rem;
  color: #374151;
  line-height: 1.55;
  padding: 10px 12px;
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 8px;
}

.result-list li::before {
  content: "›";
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.result-list .item-field {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

.result-empty {
  font-size: .875rem;
  color: #16a34a;
  font-weight: 600;
  margin: 0;
  padding: 10px 0 2px;
}

/* ── suggestions ─────────────────────────────────────────────────────────── */

.suggestion-list {
  display: grid;
  gap: 10px;
}

.suggestion-item {
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.suggestion-item__pair {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-item__original {
  font-size: .85rem;
  color: #dc2626;
  text-decoration: line-through;
  font-weight: 600;
}

.suggestion-item__arrow {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.suggestion-item__improved {
  font-size: .85rem;
  color: #16a34a;
  font-weight: 700;
}

.suggestion-item__reason {
  font-size: .81rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ── rewrite section ─────────────────────────────────────────────────────── */

.result-section--rewrite {
  border-color: #c7d9f9;
  background: #fafcff;
}

.rewrite-note {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.rewrite-text {
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 14px;
  max-height: 340px;
  overflow-y: auto;
}

.copy-btn {
  background: var(--primary-soft);
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: .15s ease;
  margin-left: auto;
}
.copy-btn:hover { background: #d1e3ff; }

.use-btn {
  width: 100%;
  justify-content: center;
  font-size: .88rem;
  border-color: #c7d9f9;
}
.use-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── btn reset for this page (already in dashboard.css but repeated for safety) */
.btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  transition: .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary {
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(29,78,216,.18);
}

.btn--ghost {
  background: #fff;
  border: 1px solid #c8daf9;
  color: var(--primary);
}

/* ── check button loading state ──────────────────────────────────────────── */
.btn--loading {
  opacity: .75;
  pointer-events: none;
}

/* ── toast (reused from dashboard) ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e293b;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
