/* =====================================================================
   Veralie Care — Design System
   Palette:   sage/pounamu green (trust) + muted clay/pohutukawa (warmth)
   Type:      Fraunces (display, warm serif) + Public Sans (body/utility)
   Signature: soft koru-inspired wave dividers + "leaf corner" cards
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Colour */
  --bg:            #FAF8F3;
  --bg-alt:        #F1EADC;
  --bg-deep:       #EDE4D2;
  --ink:           #22312B;
  --ink-soft:      #51625A;
  --primary:       #3F6D5D;
  --primary-dark:  #294A3E;
  --primary-light: #DCE8E1;
  --accent:        #B5573F;
  --accent-dark:   #8F4130;
  --accent-light:  #F1DED4;
  --line:          #DED2B8;
  --white:         #FFFFFF;
  --error:         #A3372A;
  --success:       #2E6B4F;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-leaf: 40px 16px 40px 16px;
  --shadow-soft: 0 12px 30px -14px rgba(34, 49, 43, 0.28);
  --shadow-card: 0 4px 18px -6px rgba(34, 49, 43, 0.18);
  --max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--primary-dark);
}
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 0.75em;
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 100px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); color: var(--white); box-shadow: var(--shadow-soft); }
.btn-outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.btn-secondary { background: var(--primary); color: var(--white); }
.btn-secondary:hover { background: var(--primary-dark); color: var(--white); }
.btn-ghost { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--error); color: var(--white); }

/* ---------------------------------------------------------------------
   Top utility bar + Header / Nav
   --------------------------------------------------------------------- */
.topbar {
  background: var(--primary-dark);
  color: var(--primary-light);
  font-size: 0.85rem;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.topbar a { color: var(--primary-light); }
.topbar a:hover { color: var(--white); }
.topbar-links a { margin-left: 18px; }

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-dark);
}
.brand-mark { color: var(--accent); }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.93rem;
  padding: 10px 12px;
  border-radius: 100px;
}
.main-nav a:hover, .main-nav a.active { color: var(--primary-dark); background: var(--primary-light); }
.header-ctas { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--primary-dark);
  cursor: pointer;
}

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 6px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .header-ctas { display: none; width: 100%; flex-direction: column; }
  .header-ctas.open { display: flex; padding-bottom: 12px; }
  .site-header .container { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 62%, #4C7C69 100%);
  color: var(--white);
  overflow: hidden;
  padding: 90px 0 110px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% -10%;
  height: 260px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero .container { position: relative; z-index: 2; max-width: 780px; }
.hero h1 { color: var(--white); }
.hero p.lead { color: rgba(255,255,255,0.88); font-size: 1.15rem; max-width: 560px; }
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-koru { position: absolute; top: -60px; right: -60px; width: 340px; opacity: 0.18; z-index: 1; }

.page-hero {
  background: linear-gradient(160deg, var(--primary-dark), var(--primary));
  color: var(--white);
  padding: 64px 0 84px;
  position: relative;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 200px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.page-hero .container { position: relative; z-index: 2; max-width: 760px; }
.page-hero h1 { color: var(--white); margin-bottom: 0.3em; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 14px; }
.breadcrumb a { color: rgba(255,255,255,0.85); }

/* ---------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------- */
.section { padding: 76px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-header.left { margin-left: 0; text-align: left; }

/* koru wave divider */
.wave-divider { display: block; width: 100%; height: 46px; margin-top: -1px; }
.wave-divider path { fill: var(--bg); }
.wave-divider.alt path { fill: var(--bg-alt); }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-leaf);
  padding: 30px;
  box-shadow: var(--shadow-card);
}
.card-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 14px 6px 14px 6px;
  margin-bottom: 16px;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.card a.card-link { font-weight: 700; font-size: 0.9rem; }

.photo-frame {
  background: linear-gradient(135deg, var(--primary-light), var(--bg-alt));
  border-radius: var(--radius-leaf);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.photo-frame span {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0 20px;
  opacity: 0.75;
}
.photo-frame svg { width: 48px; height: 48px; margin-bottom: 10px; opacity: 0.6; }
.photo-frame.tall { aspect-ratio: 3/4; }
.photo-frame.wide { aspect-ratio: 16/9; }
.photo-frame.square { aspect-ratio: 1/1; }

/* ---------------------------------------------------------------------
   Testimonials
   --------------------------------------------------------------------- */
.testimonial {
  background: var(--white);
  border-radius: var(--radius-leaf);
  border: 1px solid var(--line);
  padding: 30px;
  position: relative;
}
.testimonial::before {
  content: "\201C";
  font-family: var(--font-display);
  font-size: 3.4rem;
  color: var(--accent-light);
  position: absolute;
  top: 6px;
  left: 20px;
  line-height: 1;
}
.testimonial blockquote { margin: 18px 0 14px; font-family: var(--font-display); font-size: 1.08rem; font-style: italic; color: var(--ink); }
.testimonial cite { font-style: normal; font-weight: 700; font-size: 0.88rem; color: var(--primary-dark); display: block; }
.testimonial .rel { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------------
   Callout / CTA band
   --------------------------------------------------------------------- */
.cta-band {
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 { color: var(--white); margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,0.88); margin: 0; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-card);
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--primary-dark);
}
.form-row .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=date], input[type=number], input[type=file], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); background: var(--white); }

.radio-group, .checkbox-group { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.radio-group label, .checkbox-group label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 0.92rem; color: var(--ink);
  margin: 0;
}
.radio-group input, .checkbox-group input { width: auto; }

fieldset { border: 1.5px dashed var(--line); border-radius: 12px; padding: 20px; margin: 0 0 22px; }
legend { font-family: var(--font-display); font-weight: 600; padding: 0 8px; color: var(--primary-dark); }

.notice-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 22px;
}
.notice-box.warn { background: var(--accent-light); border-color: var(--accent); }

/* Alerts / flash messages */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 0.92rem; font-weight: 500; }
.alert-success { background: #E4F1EA; color: var(--success); border: 1px solid #BFE0CE; }
.alert-error { background: #F7E3E0; color: var(--error); border: 1px solid #EABDB6; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #C6DAD0; }

/* ---------------------------------------------------------------------
   Tables (admin + applicant listings)
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left; background: var(--primary-light); color: var(--primary-dark);
  padding: 12px 16px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
}
tbody td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--bg-alt); }

.badge-status { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 0.76rem; font-weight: 700; }
.badge-received { background: #E4E9F1; color: #3A4E82; }
.badge-review { background: #FBF0D6; color: #916A0A; }
.badge-shortlisted { background: #DCEBE2; color: var(--success); }
.badge-interview { background: #E3E0F5; color: #4B3D9E; }
.badge-successful { background: #DCF0E1; color: #1F7A44; }
.badge-unsuccessful { background: #F7E3E0; color: var(--error); }

/* ---------------------------------------------------------------------
   Job cards / filters
   --------------------------------------------------------------------- */
.job-filters {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: end;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px; margin-bottom: 30px;
}
.job-filters .form-row { margin-bottom: 0; flex: 1; min-width: 180px; }
.job-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 24px; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center;
}
.job-card .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-soft); margin-top: 4px; }
.job-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.tag { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 0.76rem; font-weight: 700; padding: 4px 12px; border-radius: 100px; }
.tag.tag-intl { background: var(--accent-light); color: var(--accent-dark); }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,0.82); padding: 60px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; margin-bottom: 40px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.site-footer a { color: rgba(255,255,255,0.78); display: block; margin-bottom: 10px; font-size: 0.92rem; }
.site-footer a:hover { color: var(--white); }
.footer-brand { font-family: var(--font-display); font-size: 1.4rem; color: var(--white); margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* ---------------------------------------------------------------------
   Dashboard shells (applicant + admin)
   --------------------------------------------------------------------- */
.dash-shell { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .dash-shell { grid-template-columns: 1fr; } }
.dash-sidebar {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px; position: sticky; top: 90px;
}
.dash-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; color: var(--ink); margin-bottom: 4px; }
.dash-sidebar a:hover, .dash-sidebar a.active { background: var(--primary-light); color: var(--primary-dark); }
.dash-sidebar .divider { border-top: 1px solid var(--line); margin: 10px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.stat-card .num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 26px; margin-bottom: 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.panel-header h2, .panel-header h3 { margin: 0; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }

/* ---------------------------------------------------------------------
   Login / auth screens
   --------------------------------------------------------------------- */
.auth-shell { min-height: calc(100vh - 300px); display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.auth-card { width: 100%; max-width: 440px; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.small { font-size: 0.85rem; }
.muted { color: var(--ink-soft); }
