/* --- Variables (white-label friendly) --- */
:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --border: #e5e7eb;
  --border-focus: #1c1c1e;
  --accent: #6366f1;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --max: 720px;
  --max-wide: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* --- Layout --- */
.page {
  min-height: 100vh;
  padding: 2.5rem 1.25rem 4rem;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
}

.container--wide {
  max-width: var(--max-wide);
}

/* --- Header / brand --- */
.site-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4f4f5, #e4e4e7);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.agency-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

/* Listing page title */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.75rem;
  color: var(--text);
}

/* --- Filters --- */
.filters-wrap {
  margin-bottom: 2rem;
}

.filters-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .filters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.filter-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

.filter-select:hover {
  border-color: #d1d5db;
}

.filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

/* --- Job groups --- */
.dept-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.dept-heading:first-of-type {
  margin-top: 0;
}

.job-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.job-row:last-child {
  border-bottom: none;
}

.job-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
}

.job-title a {
  font-weight: 500;
}

.job-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.job-pay {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* --- Detail: top bar --- */
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 599px) {
  .detail-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .detail-top .detail-header-inner {
    order: 2;
    width: 100%;
    text-align: center;
  }

  .detail-top .back-link {
    order: 1;
  }

  .detail-top .detail-spacer {
    display: none;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.back-link svg {
  flex-shrink: 0;
}

.detail-header-inner {
  flex: 1;
  text-align: center;
}

.detail-header-inner .site-header {
  margin-bottom: 0;
}

.job-detail-title {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 1.25rem 0 0;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.tab {
  padding: 0.65rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-panels {
  margin-top: 1.75rem;
}

.tab-panel[hidden] {
  display: none;
}

/* --- Two columns detail --- */
.detail-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .detail-grid {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }
}

.meta-sidebar {
  border-top: 1px solid var(--border);
  padding-top: 0;
}

@media (min-width: 800px) {
  .meta-sidebar {
    border-top: none;
    padding-top: 0;
    border-right: 1px solid var(--border);
    padding-right: 1.5rem;
  }
}

.meta-block {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.meta-block:last-child {
  border-bottom: none;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.2rem;
}

.meta-value {
  font-size: 0.9375rem;
  margin: 0;
  color: var(--text);
}

.prose {
  font-size: 0.9375rem;
  color: var(--text);
  max-width: 42rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

/* --- Form --- */
.apply-form {
  max-width: 32rem;
}

.form-field {
  margin-bottom: 1.25rem;
}

.address-fields {
  margin: 0 0 1.25rem;
}

.address-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 540px) {
  .address-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.9fr);
  }
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.req {
  color: #dc2626;
  font-weight: 600;
}

.input,
.textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.input::placeholder {
  color: var(--text-subtle);
}

.file-drop {
  position: relative;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background: #fafafa;
  min-height: 7.5rem;
}

.file-drop-secondary {
  background: #f8fafc;
}

/* Wrapping control + visuals in <label> restores native click handling (Safari/WebKit often ignores opacity:0 overlays). */
.file-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
  min-height: 4rem;
  cursor: pointer;
  text-align: center;
}

/* Decorative layer sits under the transparent input */
.file-drop-stack {
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.file-drop-stack .file-hint {
  display: block;
}

/*
 * Nearly invisible but not opacity:0 — some browsers ignore hits on fully transparent file inputs.
 * Large tap target + font-size avoids iOS quirks on file controls.
 */
.file-input-overlay {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0.02;
  cursor: pointer;
  z-index: 10;
  font-size: max(16px, 1rem);
  -webkit-appearance: none;
  appearance: none;
}

.form-label-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.input-textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.5;
}

.file-chip-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  font-size: 0.8125rem;
  max-width: 100%;
}

.file-chip-name {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.15rem 0.25rem;
  font-family: inherit;
}

.file-chip-remove:hover {
  color: #b91c1c;
}

.file-drop:focus-within {
  border-color: var(--accent);
  background: #f5f5ff;
}

.file-input:not(.file-input-overlay) {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.file-btn:hover {
  background: #eef2ff;
}

.file-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.file-name {
  font-size: 0.8125rem;
  color: var(--text);
  margin-top: 0.5rem;
  word-break: break-all;
}

.btn-submit {
  margin-top: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-submit:hover {
  opacity: 0.92;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.success-banner {
  display: none;
  padding: 1rem 1.25rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.success-banner.is-visible {
  display: block;
}

/* --- Root hub (`/`) — multi-tenant board; no default employer shown */
.hub-landing {
  text-align: center;
  padding: 1rem 0 2rem;
  max-width: 36rem;
  margin: 0 auto;
}

.hub-brand {
  margin-bottom: 1.5rem;
}

.hub-logo-img {
  display: block;
  margin: 0 auto 0.75rem;
  max-height: 56px;
  width: auto;
  max-width: min(240px, 100%);
  object-fit: contain;
}

.hub-logo-img[hidden] {
  display: none !important;
}

.hub-logo-mark {
  margin-bottom: 0.5rem;
}

.hub-logo-mark[hidden] {
  display: none !important;
}

.hub-product-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hub-headline {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hub-lead,
.hub-supporting {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.hub-actions {
  margin: 2rem 0 0;
}

.hub-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff !important;
  background: var(--text);
  border-radius: var(--radius-sm);
  text-decoration: none !important;
}

.hub-cta-primary:hover {
  opacity: 0.92;
  color: #fff !important;
}

/* --- Applicant intake (general application) --- */
.intake-top {
  margin-bottom: 1.25rem;
}

.intake-lead {
  margin: 0 0 1.75rem;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.intake-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  background: #fafafa;
}

.intake-panel__title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.intake-panel__text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.55;
}

.listing-intake-link {
  margin: -0.75rem 0 1.75rem;
  font-size: 0.875rem;
}

.listing-intake-link a {
  font-weight: 500;
}
