@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --black: #3d1f2e;
  --white: #ffffff;
  --grey-1: #fff5f8;
  --grey-2: #f2dbe4;
  --grey-3: #cfa8ba;
  --grey-4: #7a5466;
  --focus: #ffe16a;
  --surface: #fffafd;
  --brand: #c95f88;
  --brand-deep: #a9436d;
  --accent: #f2a3be;
  --error: #d4351c;
  --success: #3f7b5a;
  --warning: #f47738;
  --font: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--black);
  background: var(--surface);
}

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

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  background: var(--focus);
  color: var(--black);
  text-decoration: none;
}

/* ---- Layout ---- */

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

/* ---- Header ---- */

.site-header {
  background: #8a3358;
  color: var(--white);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-logo:hover {
  text-decoration: underline;
  text-decoration-color: var(--white);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--white);
}

.nav-user .nav-link {
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white);
  font-size: 0.95rem;
  font-family: var(--font);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-text:hover {
  text-decoration-thickness: 2px;
}

/* ---- Main ---- */

.site-main {
  padding: 2rem 0 3rem;
  min-height: calc(100vh - 140px);
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--grey-2);
  padding: 1.5rem 0;
  background: var(--white);
  font-size: 0.875rem;
  color: var(--grey-4);
}

.site-footer p { margin: 0; }

/* ---- Buttons ---- */

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--white);
  text-decoration: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
  border-color: #bc7f98;
}

.btn-secondary:hover {
  background: #fff6fa;
}

.btn-danger {
  background: var(--white);
  color: var(--error);
  border-color: var(--error);
}

.btn-danger:hover {
  background: var(--error);
  color: var(--white);
}

.btn-sm {
  font-size: 0.875rem;
  padding: 0.3rem 0.75rem;
}

.btn-large {
  font-size: 1.125rem;
  padding: 0.75rem 1.5rem;
}

.btn-full {
  width: 100%;
  display: block;
}

/* ---- Page Header ---- */

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #efcfdb;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.results-count {
  margin: 0;
  color: var(--grey-4);
  font-size: 0.9375rem;
}

.clear-link {
  color: var(--grey-4);
  font-size: 0.875rem;
}

.page-intro {
  margin-top: 0;
  color: var(--grey-4);
}

.care-hero {
  background: var(--grey-1);
  border: 1px solid var(--grey-2);
  border-radius: 0.5rem;
  padding: 1.6rem;
  margin-bottom: 1.8rem;
}

.care-hero-kicker {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  color: #9b4267;
  font-weight: 700;
}

.care-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  line-height: 1.15;
}

.care-hero-text {
  margin: 0.8rem 0 0;
  max-width: 70ch;
  color: #6b4356;
}

.care-hero-points {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  color: #6c4558;
}

/* ---- Two-column Search Layout ---- */

.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ---- Filters Sidebar ---- */

.filters-sidebar {
  background: #fffbfe;
  border: 1px solid var(--grey-2);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.filter-heading {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #d7a8bd;
}

.filter-form { display: flex; flex-direction: column; gap: 1.25rem; }

.filter-group { display: flex; flex-direction: column; gap: 0.375rem; }

.filter-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.filter-label-small {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-4);
}

.filter-input {
  width: 100%;
  padding: 0.4375rem 0.5rem;
  border: 1px solid #c896ac;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--white);
  appearance: none;
}

.filter-input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--brand);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.salary-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ---- Job List ---- */

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.job-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #f0d7e1;
}

.job-card:first-child {
  border-top: 1px solid #f0d7e1;
}

.job-card-body { flex: 1; }

.job-card-aside {
  text-align: right;
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--grey-4);
}

.job-company {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: var(--grey-4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.job-title {
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.job-link {
  color: #8f2f59;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.job-link:hover {
  text-decoration-thickness: 3px;
}

.job-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--grey-4);
}

.job-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-icon { font-size: 0.5rem; }

.job-date {
  margin: 0 0 0.25rem;
}

.job-expires {
  margin: 0;
}

/* ---- Category Badge ---- */

.category-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid #e0b7c8;
  color: #7a3656;
  background: #fff3f8;
}

/* ---- Pagination ---- */

.pagination {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-2);
}

.pagination-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.page-link {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--grey-3);
  color: var(--black);
  text-decoration: none;
  font-size: 0.9375rem;
  min-width: 2.5rem;
  text-align: center;
}

.page-link:hover {
  background: var(--grey-1);
  border-color: var(--black);
}

.page-current {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: #b64f78;
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 700;
  min-width: 2.5rem;
  text-align: center;
}

/* ---- Job Detail ---- */

.job-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

.job-company-large {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  color: var(--grey-4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.job-detail-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

.job-detail-meta {
  margin: 0 0 2rem;
  padding: 0;
  border-top: 1px solid var(--grey-2);
  border-bottom: 1px solid var(--grey-2);
}

.meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--grey-2);
}

.meta-row:last-child { border-bottom: none; }

.meta-row dt {
  font-weight: 600;
  color: var(--grey-4);
  font-size: 0.9375rem;
}

.meta-row dd {
  margin: 0;
  font-size: 0.9375rem;
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--black);
}

.description-text {
  white-space: pre-wrap;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.apply-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-2);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.job-detail-actions {
  background: #fffbfe;
  border: 1px solid #f1d7e2;
  border-radius: 0.75rem;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.actions-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--black);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ---- Notices ---- */

.notice {
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  border-left: 4px solid;
}

.notice--warning {
  background: #fff8e5;
  border-color: var(--warning);
}

.notice--info {
  background: #e8f4e8;
  border-color: var(--success);
}

/* ---- Auth ---- */

.auth-page {
  max-width: 480px;
  padding: 2rem 0;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.auth-intro {
  color: var(--grey-4);
  margin-top: 0;
}

.auth-link {
  font-size: 0.9375rem;
}

/* ---- Forms ---- */

.form-page {
  max-width: 680px;
}

.job-form, .auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-label {
  font-size: 0.9375rem;
  font-weight: 700;
}

.field-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--grey-4);
}

.field-input, .field-select, .field-textarea {
  padding: 0.4375rem 0.5rem;
  border: 1px solid #b9879d;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--white);
  width: 100%;
  appearance: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 0;
}

.field-textarea {
  resize: vertical;
  line-height: 1.5;
}

.input-prefix {
  position: relative;
}

.input-prefix-symbol {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1rem;
  color: var(--grey-4);
}

.field-input--prefixed {
  padding-left: 1.5rem;
}

.fieldset {
  border: 1px solid #e4bfd0;
  border-radius: 0.65rem;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fieldset-legend {
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0 0.25rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-error {
  background: var(--error);
  color: var(--white);
  padding: 0.75rem 1rem;
  margin: 0;
  font-size: 0.9375rem;
}

.form-error-summary {
  background: var(--error);
  color: var(--white);
  padding: 0.75rem 1rem;
  font-weight: 600;
  margin: 0;
}

.field-error {
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}

/* ---- Tables ---- */

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.jobs-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 2px solid #bc8ea2;
  font-weight: 700;
  white-space: nowrap;
}

.jobs-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--grey-2);
  vertical-align: top;
}

.jobs-table tr:hover td {
  background: #fff5f9;
}

.table-link {
  font-weight: 600;
  color: var(--black);
}

.table-actions {
  display: flex;
  gap: 0.75rem;
  white-space: nowrap;
}

.action-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-family: var(--font);
  padding: 0;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.action-link--danger { color: var(--error); }

/* ---- Status Badges ---- */

.status-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active { background: #e8f4e8; color: var(--success); }
.status-expired { background: var(--grey-1); color: var(--grey-4); }
.status-filled { background: #f4e8f8; color: #8b3f87; }

.role-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--grey-2);
}

.role-badge--admin { background: var(--black); color: var(--white); }

/* ---- Admin ---- */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  border: 1px solid #f0d2df;
  border-radius: 0.8rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: #fff8fb;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--grey-4);
}

.admin-section {
  margin-bottom: 3rem;
}

/* ---- Photos ---- */

.job-photo {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border: 1px solid var(--grey-2);
  margin-bottom: 1.5rem;
  display: block;
}

.photo-preview {
  max-width: 200px;
  max-height: 140px;
  object-fit: cover;
  border: 1px solid var(--grey-2);
  display: block;
  margin-bottom: 0.5rem;
}

/* ---- Utilities ---- */

.text-muted { color: var(--grey-4); }
.d-block { display: block; }
.inline-form { display: inline; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--grey-3);
  color: var(--grey-4);
}

.empty-state p { margin: 0 0 1rem; }

/* ---- Responsive ---- */

@media (max-width: 800px) {
  .care-hero {
    padding: 1.2rem;
  }

  .search-layout {
    grid-template-columns: 1fr;
  }

  .job-detail-layout {
    grid-template-columns: 1fr;
  }

  .job-detail-actions {
    order: -1;
    position: static;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .job-card {
    flex-direction: column;
  }

  .job-card-aside {
    text-align: left;
  }

  .jobs-table {
    font-size: 0.875rem;
  }
}
