:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --border: #e7e5e4;
  --accent: #292524;
  --muted: #78716c;
  --hover: #f5f5f4;
  --spacing: 1.5rem;
  --radius: 2px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

header {
  margin-bottom: 3rem;
  text-align: center;
}

h1 {
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: var(--spacing);
  letter-spacing: -0.01em;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hidden {
  display: none;
}

.input-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--accent);
}

select {
  cursor: pointer;
}

button {
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

button:hover {
  background: var(--hover);
}

button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

button.primary:hover {
  background: var(--fg);
  border-color: var(--fg);
}

button.secondary {
  width: 100%;
  margin-top: 1.5rem;
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.drop-zone {
  border: 2px dashed var(--border);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--hover);
}

.drop-zone svg {
  color: var(--muted);
  margin-bottom: 1rem;
}

.drop-zone p {
  margin-bottom: 0.25rem;
}

#cv-status {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--hover);
  border-left: 3px solid var(--accent);
}

#processing {
  text-align: center;
  padding: 3rem 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

.job-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.job-card:hover {
  border-color: var(--accent);
}

.job-card h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.job-card .company {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.job-card .match-reason {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.job-card a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.job-card a:hover {
  border-bottom-color: var(--accent);
}

.error {
  background: #fef2f2;
  border-left: 3px solid #dc2626;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #991b1b;
}

@media (max-width: 640px) {
  main {
    padding: 2rem 1rem;
  }

  .panel {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }
}
