:root {
  --bg: #f7f7f5;
  --surface: #fff;
  --border: #e4e4e1;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2d6cdf;
  --accent-hover: #1f54b3;
  --danger: #c0392b;
  --success: #1e7e3a;
  --warn: #b76b00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}
.site-title {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-header nav a {
  text-decoration: none;
  color: var(--muted);
}
.site-header nav a:hover { color: var(--accent); }
.site-header nav form { margin: 0; }

/* Signed-out pages: sign in, sign up, password reset. */
.auth-card {
  max-width: 26rem;
  margin: 3rem auto;
}
.auth-card h1 { margin-top: 0; }
.auth-card .btn { width: 100%; text-align: center; }

h1 { margin: 0.5rem 0 1rem; font-size: 1.6rem; }
h2 { margin: 1.5rem 0 0.5rem; font-size: 1.2rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.flash-notice { background: #e3f1e7; color: var(--success); border: 1px solid #c5e0cb; }
.flash-alert  { background: #fde3e1; color: var(--danger);  border: 1px solid #f0c2bd; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar .spacer { flex: 1; }

.btn {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f0f0ec; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #962d22; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: top;
}
th { background: #fafaf8; font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card h2:first-child { margin-top: 0; }

.paste-hint {
  padding: 0.5rem 0.75rem;
  background: #f6f9fc;
  border: 1px dashed #cfdbe6;
  border-radius: 5px;
  margin-bottom: 1rem;
}
.paste-hint kbd {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-size: 0.92rem;
}
/* Everything text-like, by exclusion. Listing the types one by one meant a new
   input type (email, password) silently rendered unstyled and overflowed. */
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]),
.field select,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }

.error-summary {
  background: #fde3e1;
  color: var(--danger);
  border: 1px solid #f0c2bd;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.error-summary ul { margin: 0.3rem 0 0 1.25rem; padding: 0; }

.tag {
  display: inline-block;
  background: #eef0f4;
  color: var(--muted);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  margin-right: 0.25rem;
}

.status-pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-applied      { background: #e6efff; color: #2d6cdf; }
.status-interviewing { background: #fff3d6; color: var(--warn); }
.status-rejected     { background: #fde3e1; color: var(--danger); }
.status-ghosted      { background: #ececec; color: var(--muted); }
.status-offer        { background: #e3f1e7; color: var(--success); }
.status-withdrawn    { background: #ececec; color: var(--muted); }
.status-interested   { background: #f6e6ff; color: #6b3bb3; }

td.status-cell { vertical-align: middle; }
.status-form { margin: 0; display: inline-block; }
.status-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-align-last: center;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.status-select:hover { border-color: rgba(0,0,0,0.15); }
.status-select:focus { outline: none; border-color: rgba(0,0,0,0.25); box-shadow: 0 0 0 2px rgba(0,0,0,0.06); }

.status-resume-pending    { background: #ececec; color: var(--muted); }
.status-resume-generating { background: #fff3d6; color: var(--warn); }
.status-resume-ready      { background: #e3f1e7; color: var(--success); }
.status-resume-failed     { background: #fde3e1; color: var(--danger); }

/* Rendered resume — styled to look like a real document on screen + paper. */
.resume-rendered {
  background: #fff;
  padding: 2rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: Georgia, "Times New Roman", serif;
  color: #1a1a1a;
  line-height: 1.45;
  font-size: 0.95rem;
}
.resume-rendered h1 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.resume-rendered h1 + p { text-align: center; color: var(--muted); margin: 0 0 1rem; font-size: 0.9rem; }
.resume-rendered h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #aaa;
  padding-bottom: 0.15rem;
  margin: 1.25rem 0 0.5rem;
}
.resume-rendered h3 { font-size: 1rem; margin: 0.75rem 0 0.15rem; }
.resume-rendered h3 + p em,
.resume-rendered h3 + p { color: var(--muted); margin: 0 0 0.35rem; font-size: 0.88rem; font-style: italic; }
.resume-rendered ul { margin: 0.25rem 0 0.5rem 1.25rem; padding: 0; }
.resume-rendered li { margin-bottom: 0.2rem; }
.resume-rendered p { margin: 0.35rem 0; }
.resume-rendered a { color: var(--text); text-decoration: underline; }
.resume-rendered hr { border: none; border-top: 1px solid #ddd; margin: 1rem 0; }

@media print {
  .site-header, .toolbar, .flash, .card:not(.resume-print-wrap) { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .resume-rendered {
    border: none;
    padding: 0.5in 0.6in;
    font-size: 10.5pt;
  }
  @page { size: letter; margin: 0; }
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.prose { white-space: pre-wrap; }
