:root {
  --charcoal-950: #0d0f0e;
  --charcoal-900: #141715;
  --charcoal-800: #1b1f1c;
  --charcoal-700: #242925;
  --charcoal-600: #323831;
  --border: rgba(255,255,255,0.08);
  --border-soft: rgba(255,255,255,0.05);
  --ink-100: #f2f4f1;
  --ink-300: #c7cdc7;
  --ink-500: #8d968e;
  --ink-600: #6c766e;

  --emerald-300: #6fd3a3;
  --emerald-500: #2f9e73;
  --emerald-600: #24825e;
  --emerald-700: #1a6249;
  --emerald-glow: rgba(47,158,115,0.18);

  --bronze-300: #ddbd85;
  --bronze-500: #c9a15f;

  --danger: #d97b6c;

  --ff-display: 'Playfair Display', Georgia, serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-btn: 7px;

  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,0.6);
  --shadow-md: 0 12px 32px -12px rgba(0,0,0,0.5);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --charcoal-950: #f7f6f1;
  --charcoal-900: #ffffff;
  --charcoal-800: #f1efe7;
  --charcoal-700: #e6e2d7;
  --charcoal-600: #cfc9ba;
  --border: rgba(20,24,18,0.10);
  --border-soft: rgba(20,24,18,0.06);
  --ink-100: #191d18;
  --ink-300: #454b42;
  --ink-500: #6f7669;
  --ink-600: #8d9387;

  --emerald-300: #1f8a5f;
  --emerald-500: #259467;
  --emerald-600: #1c7a54;
  --emerald-700: #155f42;
  --emerald-glow: rgba(37,148,103,0.20);

  --bronze-300: #9c7a3c;
  --bronze-500: #b3873f;

  --danger: #c1483a;

  --shadow-lg: 0 24px 60px -20px rgba(30,30,20,0.18);
  --shadow-md: 0 12px 32px -12px rgba(30,30,20,0.14);

  color-scheme: light;
}

* { box-sizing: border-box; }

html { transition: background 0.2s ease; }
body, .card, .modal, input, .tag-input, .pill-toggle, .profile-card, .chip {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(47,158,115,0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(201,161,95,0.06), transparent 55%),
    var(--charcoal-950);
  color: var(--ink-100);
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

h1, h2, h3, .wordmark {
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: var(--ink-100);
  text-decoration: none;
}

.wordmark .material-symbols-rounded {
  color: var(--emerald-300);
  font-size: 22px;
}

.wordmark-icon {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  object-fit: cover;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--charcoal-900);
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover { color: var(--bronze-300); border-color: var(--charcoal-600); }
.theme-toggle:active { transform: scale(0.92); }

.lang-toggle {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border);
  background: var(--charcoal-900);
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.lang-toggle:hover { color: var(--emerald-300); border-color: var(--charcoal-600); }
.lang-toggle:active { transform: scale(0.92); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-text {
  background: none;
  color: var(--ink-300);
  padding: 8px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-text:hover { color: var(--ink-100); }
.btn-text .material-symbols-rounded { font-size: 18px; }

/* Hero */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 9vh 24px 10vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kicker {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze-300);
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  color: var(--ink-100);
}

.hero .sub {
  margin: 22px 0 40px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-300);
  font-weight: 300;
  max-width: 520px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 7px;
  padding: 11px 20px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(180deg, var(--emerald-500), var(--emerald-600));
  color: #f4fbf7;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 10px 24px -10px var(--emerald-glow);
}

.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.14) inset, 0 18px 34px -10px var(--emerald-glow); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

/* Soft primary — translucent fill, strong border. Used for top-of-modal
   call-to-actions (prepare & apply, find contacts) so they read as inviting
   next steps rather than a heavy solid CTA. */
.btn-primary-soft {
  background: rgba(47,158,115,0.14);
  border: 2px solid var(--emerald-500);
  color: var(--emerald-300);
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  box-shadow: none;
}
.btn-primary-soft:hover { background: rgba(47,158,115,0.22); border-color: var(--emerald-300); transform: translateY(-2px); box-shadow: none; }
.btn-primary-soft:active { transform: translateY(0); }

/* Save-changes / regenerate variant — blue on purpose, so a "commit" action never gets
   mistaken for a green apply/next-step CTA elsewhere on the same panel. */
.btn-save-soft {
  background: rgba(59,130,246,0.14);
  border: 2px solid #3b82f6;
  color: #3b82f6;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  box-shadow: none;
}
.btn-save-soft:hover { background: rgba(59,130,246,0.22); border-color: #60a5fa; transform: translateY(-2px); box-shadow: none; }
.btn-save-soft:active { transform: translateY(0); }

.btn-lg {
  padding: 15px 30px;
  font-size: 15px;
  border-radius: 7px;
}

.btn-lg .material-symbols-rounded { font-size: 19px; }

.btn-block { width: 100%; margin-top: 8px; }

.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-sm .material-symbols-rounded { font-size: 16px; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Mini modal — small confirmation dialog, fade in/out handled by .modal-overlay above */
.mini-modal { max-width: 400px; text-align: center; }
.mini-modal h3 { font-size: 18px; margin: 0 0 10px; color: var(--ink-100); }
.mini-modal p { font-size: 14px; color: var(--ink-300); line-height: 1.6; margin: 0 0 22px; }

/* Profiles list */
.profiles-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.profiles-section h2 {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  font-family: 'Roboto', sans-serif;
}

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

.profile-card {
  display: block;
  background: var(--charcoal-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.profile-card:hover { border-color: var(--emerald-700); transform: translateY(-2px); }

.profile-card .pc-name { font-family: 'Jost', sans-serif; font-size: 17px; font-weight: 500; color: var(--ink-100); }
.profile-card .pc-headline { font-size: 13px; color: var(--ink-500); margin-top: 6px; line-height: 1.4; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,7,0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 0.18s ease;
  transition: opacity 0.18s ease;
}

/* Set via JS right before hiding, so every overlay fades out instead of vanishing */
.modal-overlay.closing { opacity: 0; }
.modal-overlay.closing .modal,
.modal-overlay.closing .mini-modal,
.modal-overlay.closing .job-modal { transition: transform 0.18s ease; transform: scale(0.96); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--charcoal-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px 36px;
  box-shadow: var(--shadow-lg);
  animation: rise 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Modal buttons read more elegant a touch more square than the marketing page's pill CTAs */
.modal .btn, .job-modal .btn { border-radius: 4px; }

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.modal-close:hover { color: var(--ink-100); border-color: var(--charcoal-600); }

.modal h2 { font-size: 24px; margin-bottom: 8px; }
.modal-sub { color: var(--ink-500); font-size: 14px; line-height: 1.55; margin: 0 0 26px; }

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--charcoal-600);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--emerald-500);
  background: rgba(47,158,115,0.05);
}

.dropzone-icon { font-size: 30px; color: var(--emerald-300); margin-bottom: 4px; }
.dropzone-title { font-family: 'Jost', sans-serif; font-size: 16px; font-weight: 500; color: var(--ink-100); }
.dropzone-sub { font-size: 12.5px; color: var(--ink-600); }

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--charcoal-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-300);
}

.file-chip .material-symbols-rounded:first-child { color: var(--bronze-300); font-size: 18px; }
.file-chip span#fileChipName { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { background: none; border: none; color: var(--ink-600); cursor: pointer; display: flex; }
.file-chip button:hover { color: var(--danger); }

.upload-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-500);
}

.error-text {
  margin-top: 14px;
  font-size: 13px;
  color: var(--danger);
}

.success-text {
  margin-top: 14px;
  font-size: 13px;
  color: var(--emerald-300);
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--charcoal-600);
  border-top-color: var(--emerald-300);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-lg { width: 34px; height: 34px; border-width: 3px; }

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

.building-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 30px 0 10px;
}

.building-state h2 { margin-top: 4px; }

/* Form */
.field-row { display: flex; gap: 16px; margin-bottom: 16px; }
.field-row.two .field { flex: 1; min-width: 0; }
.field { flex: 1; display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-row .field { margin-bottom: 0; }

label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

.label-hint { font-weight: 300; color: var(--ink-600); text-transform: none; letter-spacing: normal; }

input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"] {
  background: var(--charcoal-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--ink-100);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="tel"]:focus, input[type="number"]:focus, input[type="date"]:focus {
  border-color: var(--emerald-500);
  background: var(--charcoal-700);
}

input::placeholder { color: var(--ink-600); }

input[type="date"] { cursor: pointer; color-scheme: dark; }
:root[data-theme="light"] input[type="date"] { color-scheme: light; }
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
  border-radius: 4px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { filter: invert(0.8); }

select {
  background: var(--charcoal-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--ink-100);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
  cursor: pointer;
}

select:focus { border-color: var(--emerald-500); background: var(--charcoal-700); }

textarea {
  background: none;
  border: none;
  border-bottom: 2.5px solid var(--border);
  border-radius: 0;
  padding: 11px 13px 11px 0;
  color: var(--ink-100);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

textarea:focus { border-bottom-color: var(--emerald-500); }
textarea::placeholder { color: var(--ink-600); }

/* Tag input */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  background: var(--charcoal-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.tag-input:focus-within { border-color: var(--emerald-500); }

.tag-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--charcoal-800);
  border: 1.5px solid var(--charcoal-600);
  color: var(--ink-100);
  font-size: 13px;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-btn);
}

.tag-pill button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 50%;
  width: 18px;
  height: 18px;
}

.tag-pill button .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 20;
}
.tag-pill button:hover { background: rgba(217,123,108,0.16); }

.tag-input input {
  flex: 1;
  min-width: 120px;
  background: none;
  border: none;
  outline: none;
  color: var(--ink-100);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 300;
  padding: 6px 4px;
}

.tag-input input::placeholder { color: var(--ink-600); }

/* Location autocomplete (geo.js) — same visual language as tag-input/tag-pill */
.geo-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  background: var(--charcoal-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  min-height: 44px;
  transition: border-color 0.15s ease;
}
.geo-chip-box:focus-within { border-color: var(--emerald-500); }

.geo-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--charcoal-800);
  border: 1.5px solid var(--charcoal-600);
  color: var(--ink-100);
  font-size: 13px;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-btn);
}

.geo-chip .geo-chip-x {
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-600);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.geo-chip .geo-chip-x:hover { color: var(--danger); }

.geo-chip-search {
  flex: 1;
  min-width: 120px;
  background: none;
  border: none;
  outline: none;
  color: var(--ink-100);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 300;
  padding: 6px 4px;
}
.geo-chip-search::placeholder { color: var(--ink-600); }

.geo-single-input { background-image: none; }

.geo-ac-panel {
  position: absolute;
  z-index: 500;
  display: none;
  background: var(--charcoal-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  min-width: 220px;
}

.geo-ac-item {
  padding: 9px 13px;
  font-size: 13px;
  color: var(--ink-300);
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}
.geo-ac-item:last-child { border-bottom: none; }
.geo-ac-item:hover, .geo-ac-item.active { background: var(--charcoal-700); color: var(--ink-100); }
.geo-ac-empty { padding: 9px 13px; font-size: 12.5px; color: var(--ink-600); }

/* Pill toggles (work mode) */
.pill-toggles { display: flex; flex-wrap: wrap; gap: 8px; }

.pill-toggle {
  background: var(--charcoal-800);
  border: 1.5px solid var(--charcoal-600);
  color: var(--ink-300);
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-toggle:hover { border-color: var(--charcoal-600); }

.pill-toggle.active {
  background: var(--emerald-700);
  border-color: var(--emerald-500);
  color: #eafff4;
}

form { margin-top: 6px; }

@media (max-width: 560px) {
  .field-row.two { flex-direction: column; }
  .modal { padding: 32px 22px 28px; }
  .topbar { padding: 22px; }
}

/* Global loading overlay — blocks all interaction while an async/AI operation is running.
   Shared across every page (landing, signup, login, dashboard). */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(13,15,14,0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
}
:root[data-theme="light"] .global-loading-overlay { background: rgba(247,246,241,0.7); }

.global-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--charcoal-900);
  border: 1px solid var(--border);
  padding: 30px 38px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--ink-100);
  font-size: 14px;
  max-width: 320px;
  text-align: center;
}
