:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e7e9ee;
  --muted: #9aa2b1;
  --accent: #5b8cff;
  --accent-2: #3f6ee0;
  --danger: #e5566d;
  --success: #3fbf7f;
  --warning: #e0a83f;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

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

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.auth-card h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

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

textarea { resize: vertical; }

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}

.pw-requirements {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pw-requirements li {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-requirements li::before {
  content: "○";
  font-size: 0.75rem;
  width: 1em;
}

.pw-requirements li.met {
  color: var(--success);
}

.pw-requirements li.met::before {
  content: "✓";
}

.banner {
  background: rgba(224,168,63,0.12);
  border: 1px solid rgba(224,168,63,0.4);
  color: #f0c063;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.banner[hidden] { display: none; }

button {
  cursor: pointer;
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
}

.btn:hover { background: var(--accent-2); }
.btn.full { width: 100%; }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.secondary:hover { background: var(--border); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 0.82rem; }

.error-msg {
  background: rgba(229, 86, 109, 0.12);
  border: 1px solid rgba(229, 86, 109, 0.4);
  color: #ff9fb0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Dashboard */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar .user-info { display: flex; align-items: center; gap: 14px; font-size: 0.88rem; color: var(--muted); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar select { width: auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

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

.card-head h3 { margin: 0 0 2px; font-size: 1.02rem; }
.card-head .role { color: var(--muted); font-size: 0.88rem; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge.Applied { background: rgba(91,140,255,0.15); color: #8fb0ff; }
.badge.Interview { background: rgba(224,168,63,0.15); color: #f0c063; }
.badge.Offer { background: rgba(63,191,127,0.15); color: #6fe0a4; }
.badge.Rejected { background: rgba(229,86,109,0.15); color: #ff9fb0; }
.badge.Ghosted { background: rgba(154,162,177,0.15); color: var(--muted); }

.card .meta {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card .notes {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 4.5em;
  overflow: hidden;
}

.card-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  padding: 28px;
}

.modal h2 { margin-top: 0; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.modal-grid .field.full { grid-column: 1 / -1; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  z-index: 200;
}
.toast[hidden] { display: none; }
.toast.error { border-color: rgba(229,86,109,0.5); color: #ff9fb0; }
