/* Resume Lab — light, modern SaaS demo (no frameworks) */

:root {
  --bg-page: #f4f6fb;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-ring: rgba(79, 70, 229, 0.35);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 85% -5%, rgba(124, 58, 237, 0.09), transparent 55%),
    radial-gradient(700px 380px at 10% 0%, rgba(79, 70, 229, 0.1), transparent 50%),
    linear-gradient(180deg, #eef2ff 0%, var(--bg-page) 38%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

/* Hero */
.hero {
  margin-bottom: 28px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 999px;
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.hero__lead {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.panel--json {
  margin-bottom: 0;
}

.panel__head {
  margin-bottom: 18px;
}

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

.panel__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.panel__hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* Form */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field {
  margin-bottom: 14px;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.field__control {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.field__control:hover {
  border-color: var(--border-strong);
}

.field__control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: #fff;
}

.field__control--textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.55;
}

/* File upload */
.file-field {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 6px;
  align-items: center;
  padding: 16px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.file-field:hover {
  border-color: rgba(79, 70, 229, 0.45);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.file-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.file-field__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-field__icon {
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-soft);
}

.file-field__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text);
}

.file-field__text strong {
  font-weight: 600;
}

.file-field__sub {
  font-size: 12px;
  color: var(--text-soft);
}

.file-field__name {
  grid-column: 2;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.file-field__name:empty::before {
  content: attr(data-empty);
  color: var(--text-soft);
  font-style: italic;
}

/* Buttons */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 8px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn--ghost {
  color: var(--text);
  background: #fff;
  border-color: var(--border);
  min-height: 40px;
  padding: 0 16px;
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: #fafbfc;
}

.btn--ghost.is-done {
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.06);
}

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: block;
}

.btn.is-loading .btn__label {
  opacity: 0.92;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status {
  font-size: 13px;
  font-weight: 500;
}

.status--muted {
  color: var(--text-soft);
}

.status--ok {
  color: var(--success);
}

.status--warn {
  color: var(--warning);
}

.status--bad {
  color: var(--danger);
}

/* Results section reveal */
.results-section {
  margin-bottom: 20px;
}

.results-section:not([hidden]) {
  animation: fadeUp 0.45s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.results-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Dashboard metrics */
.metric-board {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-md);
}

.metric-board__title {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
}

.metric-board__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 860px) {
  .metric-board__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metric-card {
  padding: 14px 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
}

.metric-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.metric-card__value {
  margin: 8px 0 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.metric-card__bar {
  height: 6px;
  border-radius: 999px;
  background: #e8ecf4;
  overflow: hidden;
}

.metric-card__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  transition: width 0.5s ease;
}

/* Summary highlight */
.summary-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(124, 58, 237, 0.05));
  box-shadow: var(--shadow-sm);
}

.summary-card__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.summary-card__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

/* Two-column results */
.results-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .results-row {
    grid-template-columns: 1fr;
  }
}

.subpanel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.subpanel__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

/* Info grid */
.info-grid {
  display: grid;
  gap: 10px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafbfc;
}

.info-item__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.info-item__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

/* Keywords */
.kw-block + .kw-block {
  margin-top: 14px;
}

.kw-block__heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
}

.tag--jd {
  border-color: rgba(79, 70, 229, 0.25);
  background: rgba(79, 70, 229, 0.06);
  color: var(--accent);
}

.tag--cv {
  border-color: rgba(124, 58, 237, 0.22);
  background: rgba(124, 58, 237, 0.06);
  color: var(--accent-2);
}

.tag--hit {
  border-color: rgba(5, 150, 105, 0.28);
  background: rgba(5, 150, 105, 0.07);
  color: var(--success);
}

.tag--placeholder {
  color: var(--text-soft);
  font-style: italic;
}

/* JSON code block */
.code-shell {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.code-block {
  margin: 0;
  max-height: min(52vh, 440px);
  overflow: auto;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: #e2e8f0;
  background: linear-gradient(180deg, #0f172a 0%, #0c1222 100%);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.code-block:focus {
  outline: 2px solid rgba(99, 102, 241, 0.6);
  outline-offset: 2px;
}

.footer-note {
  margin: 24px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .results-section:not([hidden]),
  .metric-card__bar-fill {
    animation: none !important;
    transition: none !important;
  }
}
