/* ─────────────────────────────────────────────────────────────────────────────
   Moja Dadilja — Main Stylesheet
   Warm, family-friendly, accessible. Built mobile-first.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Brand */
  --c-primary: #ff7a8a;
  --c-primary-dark: #e85f70;
  --c-primary-light: #ffd4d9;
  --c-accent: #6fb3c6;
  --c-accent-dark: #4d9aac;

  /* Neutrals */
  --c-bg: #fff8f9;
  --c-surface: #ffffff;
  --c-text: #2a2a3a;
  --c-text-muted: #6f6f80;
  --c-border: #ece6e8;
  --c-border-strong: #d8cfd2;

  /* Status */
  --c-success: #4caf85;
  --c-success-bg: #e3f5ec;
  --c-warning: #e6a23c;
  --c-warning-bg: #fdf2e1;
  --c-danger: #e25c5c;
  --c-danger-bg: #fbe5e5;
  --c-info: #5da9d7;
  --c-info-bg: #e6f1f9;

  /* Typography */
  --f-heading: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;

  /* Spacing scale (8px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Radii & shadows */
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
  --sh-sm: 0 1px 3px rgba(0,0,0,.05);
  --sh-md: 0 4px 14px rgba(0,0,0,.06);
  --sh-lg: 0 12px 28px rgba(0,0,0,.08);

  /* Layout */
  --layout-narrow: 720px;
  --layout-wide: 1180px;
  --header-h: 64px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--f-heading); line-height: 1.2; margin: 0 0 var(--sp-4); }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 var(--sp-4); }
a { color: var(--c-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
small { color: var(--c-text-muted); font-size: 13px; }

.muted { color: var(--c-text-muted); }
.hint { color: var(--c-text-muted); font-size: 14px; }

/* Skip link (a11y) */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--c-primary); color: #fff; padding: 8px 16px; z-index: 1000;
}
.skip-link:focus { left: 16px; top: 16px; }

/* Layout */
.container { max-width: var(--layout-wide); margin: 0 auto; padding: 0 var(--sp-4); }
.container.narrow { max-width: var(--layout-narrow); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 248, 249, 0.95);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; color: var(--c-text); }
.brand:hover { text-decoration: none; }
.brand__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-primary); color: #fff; font-size: 18px;
}
.brand__name { font-family: var(--f-heading); font-size: 18px; }
.site-nav { display: flex; align-items: center; gap: var(--sp-4); }
.site-nav a { color: var(--c-text); font-weight: 500; padding: 6px 4px; }
.site-nav .nav-bell { font-size: 18px; }
.logout-form { display: inline; }
.link-button { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 10px 18px; border-radius: var(--r-pill);
  font-family: var(--f-body); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; user-select: none;
  transition: transform .08s ease, background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--secondary { background: var(--c-accent); color: #fff; }
.btn--secondary:hover { background: var(--c-accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-text); border-color: var(--c-border-strong); }
.btn--ghost:hover { background: var(--c-surface); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 14px 24px; font-size: 16px; }
.btn--block { width: 100%; display: flex; }

/* Forms */
.form-card { background: var(--c-surface); padding: var(--sp-5); border-radius: var(--r-md); box-shadow: var(--sh-sm); border: 1px solid var(--c-border); margin-bottom: var(--sp-5); }
.form-row { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.form-row--two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-row--four { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-4); align-items: end; }
.form-row label { font-weight: 600; font-size: 14px; color: var(--c-text); margin-bottom: var(--sp-1); }
.input, .select, .textarea, input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  font: inherit;
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); }
.textarea { min-height: 96px; resize: vertical; }
.input--xs { max-width: 100px; }
.checkbox-row { display: flex; align-items: center; gap: var(--sp-2); }
.checkbox-row input { width: auto; }
.field-error { color: var(--c-danger); font-size: 13px; }
.form-error { background: var(--c-danger-bg); color: var(--c-danger); padding: var(--sp-3); border-radius: var(--r-sm); margin-bottom: var(--sp-4); }
.form-meta { text-align: center; margin-top: var(--sp-4); font-size: 14px; }

/* Messages */
.messages { padding: var(--sp-3) 0; }
.message {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); margin-bottom: var(--sp-2);
  font-size: 14px;
}
.message--success { background: var(--c-success-bg); color: var(--c-success); }
.message--info { background: var(--c-info-bg); color: var(--c-info); }
.message--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.message--error { background: var(--c-danger-bg); color: var(--c-danger); }

/* Footer */
.site-footer { border-top: 1px solid var(--c-border); padding: var(--sp-5) 0; margin-top: var(--sp-7); font-size: 14px; color: var(--c-text-muted); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); }
.footer-row p { margin: 0; }

/* Home page */
.page--home main { padding: 0; }
.hero {
  background: linear-gradient(135deg, var(--c-primary-light) 0%, #fff8f9 70%);
  padding: var(--sp-8) 0;
}
.hero__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--sp-7); align-items: center; }
.hero__title { font-size: clamp(32px, 5vw, 56px); }
.hero__subtitle { font-size: 18px; color: var(--c-text-muted); margin-bottom: var(--sp-5); }
.hero__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero__visual { position: relative; height: 360px; }
.hero__card { position: absolute; border-radius: var(--r-lg); box-shadow: var(--sh-lg); }
.hero__card--1 { width: 220px; height: 280px; top: 0; left: 20px; background: var(--c-primary); transform: rotate(-6deg); }
.hero__card--2 { width: 220px; height: 280px; top: 30px; left: 120px; background: var(--c-accent); transform: rotate(4deg); }
.hero__card--3 { width: 220px; height: 280px; top: 60px; left: 220px; background: #ffd685; transform: rotate(-2deg); }

.features { padding: var(--sp-8) 0; }
.section-title { text-align: center; margin-bottom: var(--sp-6); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-5); }
.feature-card { background: var(--c-surface); padding: var(--sp-5); border-radius: var(--r-md); box-shadow: var(--sh-sm); border: 1px solid var(--c-border); }
.feature-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--c-primary-light); color: var(--c-primary-dark);
  font-weight: 700; font-size: 20px; margin-bottom: var(--sp-3);
}

.cta { padding: var(--sp-8) 0; }
.cta__inner { background: var(--c-primary); color: #fff; padding: var(--sp-7); border-radius: var(--r-lg); text-align: center; }
.cta__inner h2 { color: #fff; }
.cta__inner p { opacity: .9; }
.cta__inner .btn--primary { background: #fff; color: var(--c-primary-dark); }

@media (max-width: 760px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
}

/* Wizard */
.page--wizard .site-main { padding: var(--sp-5) 0; }
.wizard { max-width: var(--layout-wide); margin: 0 auto; padding: 0 var(--sp-4); display: grid; grid-template-columns: 260px 1fr; gap: var(--sp-5); }
.wizard__sidebar { background: var(--c-surface); padding: var(--sp-5); border-radius: var(--r-md); box-shadow: var(--sh-sm); border: 1px solid var(--c-border); height: fit-content; position: sticky; top: calc(var(--header-h) + var(--sp-3)); }
.wizard__title { font-size: 18px; margin-bottom: var(--sp-3); }
.wizard__progress-text { font-size: 13px; color: var(--c-text-muted); margin-bottom: var(--sp-2); }
.wizard__progress-bar { width: 100%; height: 8px; background: var(--c-border); border-radius: var(--r-pill); overflow: hidden; margin-bottom: var(--sp-4); }
.wizard__progress-fill { height: 100%; background: var(--c-primary); transition: width .3s ease; }
.wizard__steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.wizard__step { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); font-size: 14px; color: var(--c-text-muted); }
.wizard__step.is-current { background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }
.wizard__step.is-done { color: var(--c-success); }
.wizard__step.is-locked { opacity: .55; }
.wizard__step-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-border); font-size: 12px; font-weight: 700; }
.wizard__step.is-done .wizard__step-icon { background: var(--c-success); color: #fff; }
.wizard__step.is-current .wizard__step-icon { background: var(--c-primary); color: #fff; }
.wizard__main { min-width: 0; }
.wizard__heading { margin-bottom: var(--sp-2); }
.wizard__lede { color: var(--c-text-muted); margin-bottom: var(--sp-5); }
.wizard__nav { display: flex; justify-content: space-between; margin-top: var(--sp-4); }

@media (max-width: 880px) {
  .wizard { grid-template-columns: 1fr; }
  .wizard__sidebar { position: static; }
}

/* Upload list / docs */
.upload-list, .lang-form, .photo-gallery-form, .children-list { background: var(--c-surface); padding: var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--c-border); margin-bottom: var(--sp-5); }
.doc-list { list-style: none; padding: 0; margin: 0 0 var(--sp-4); }
.doc-item { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3); background: var(--c-bg); border-radius: var(--r-sm); margin-bottom: var(--sp-2); }
.doc-item small { display: block; }
.upload-form { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }
.upload-form--inline { flex-direction: row; flex-wrap: wrap; align-items: end; border-top: 0; padding-top: 0; }
.upload-form--inline > * { flex: 0 1 auto; }

/* Chip list */
.chip-list { list-style: none; padding: 0; margin: 0 0 var(--sp-4); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { background: var(--c-primary-light); color: var(--c-primary-dark); padding: 4px 12px; border-radius: var(--r-pill); font-size: 14px; display: inline-flex; align-items: center; gap: var(--sp-2); }
.chip__remove { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.photo-tile, .photo-grid img { aspect-ratio: 1; border-radius: var(--r-sm); object-fit: cover; position: relative; overflow: hidden; }
.photo-tile__remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: 0; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; }

/* Children */
.child-cards { list-style: none; padding: 0; margin: 0 0 var(--sp-4); }
.child-card { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3); background: var(--c-bg); border-radius: var(--r-sm); margin-bottom: var(--sp-2); }
.child-form-collapse { background: var(--c-bg); padding: var(--sp-3); border-radius: var(--r-sm); }
.child-form-collapse[open] { padding-bottom: var(--sp-4); }
.child-form-collapse summary { cursor: pointer; font-weight: 600; color: var(--c-primary-dark); }

/* Dashboards */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-5); gap: var(--sp-3); flex-wrap: wrap; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.card { background: var(--c-surface); padding: var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--c-border); box-shadow: var(--sh-sm); }
.stat-card .stat { font-size: 32px; font-weight: 700; color: var(--c-primary-dark); margin: var(--sp-2) 0; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--c-border); color: var(--c-text); }
.badge--success { background: var(--c-success-bg); color: var(--c-success); }
.badge--info { background: var(--c-info-bg); color: var(--c-info); }
.badge--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--pending { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--accepted { background: var(--c-success-bg); color: var(--c-success); }
.badge--rejected, .badge--cancelled, .badge--expired { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-list { list-style: none; padding: 0; margin: var(--sp-3) 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Search */
.search-filters { background: var(--c-surface); padding: var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--c-border); margin-bottom: var(--sp-5); }
.filter-checkboxes { display: flex; flex-direction: column; gap: var(--sp-1); font-size: 14px; }
.nanny-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.nanny-card { background: var(--c-surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-sm); border: 1px solid var(--c-border); transition: transform .15s, box-shadow .15s; }
.nanny-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.nanny-card__link { display: block; color: inherit; }
.nanny-card__link:hover { text-decoration: none; }
.nanny-card__photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--c-primary-light); }
.nanny-card__photo--placeholder { display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; color: var(--c-primary-dark); }
.nanny-card__body { padding: var(--sp-3); }
.nanny-card__body h3 { margin-bottom: var(--sp-1); }
.nanny-card__body .meta { font-size: 13px; color: var(--c-text-muted); }
.nanny-card__body .excerpt { font-size: 13px; margin-top: var(--sp-2); }

/* Profile page */
.profile-page { background: var(--c-surface); padding: var(--sp-6); border-radius: var(--r-md); box-shadow: var(--sh-sm); border: 1px solid var(--c-border); }
.profile-page__header { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-5); }
.profile-page__avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.profile-page__intro h1 { margin-bottom: var(--sp-1); }
.profile-page__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.profile-page section { margin-bottom: var(--sp-5); }
.profile-page section h2 { font-size: 18px; padding-bottom: var(--sp-1); border-bottom: 1px solid var(--c-border); }

/* Interview list / chat */
.interview-list { list-style: none; padding: 0; }
.interview-row { background: var(--c-surface); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); border: 1px solid var(--c-border); margin-bottom: var(--sp-2); }
.interview-row--pending { border-left: 4px solid var(--c-warning); }
.interview-row--accepted { border-left: 4px solid var(--c-success); }
.interview-row--rejected, .interview-row--cancelled, .interview-row--expired { border-left: 4px solid var(--c-danger); }
.interview-row__link { display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-2); align-items: center; color: inherit; }
.interview-row__link:hover { text-decoration: none; }
.interview-row .excerpt { grid-column: 1 / -1; font-size: 13px; color: var(--c-text-muted); margin: 0; }

.chat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.chat-thread { background: var(--c-surface); padding: var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--c-border); max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.chat-msg { max-width: 80%; padding: var(--sp-3); border-radius: var(--r-md); }
.chat-msg--me { align-self: flex-end; background: var(--c-primary-light); }
.chat-msg--them { align-self: flex-start; background: var(--c-bg); border: 1px solid var(--c-border); }
.chat-msg header { font-size: 12px; margin-bottom: var(--sp-1); color: var(--c-text-muted); }
.chat-msg p { margin: 0; }
.chat-compose { display: flex; gap: var(--sp-2); align-items: flex-end; }
.chat-compose .textarea { min-height: 60px; }
.action-bar { background: var(--c-info-bg); padding: var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-4); }
.respond-form { display: grid; gap: var(--sp-2); }
.cancel-form { margin-top: var(--sp-3); text-align: right; }

/* Notifications list */
.notification-list { list-style: none; padding: 0; }
.notif { background: var(--c-surface); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); border: 1px solid var(--c-border); margin-bottom: var(--sp-2); }
.notif--unread { border-left: 4px solid var(--c-primary); }
.notif__link { color: inherit; }
.notif__link:hover { text-decoration: none; }

/* Empty / success states */
.empty-state, .success-state { background: var(--c-surface); padding: var(--sp-7); border-radius: var(--r-md); text-align: center; border: 1px solid var(--c-border); }
.success-state__icon { display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 50%; background: var(--c-primary); color: #fff; font-size: 40px; margin-bottom: var(--sp-4); }

/* Lede */
.lead { font-size: 18px; color: var(--c-text-muted); margin-bottom: var(--sp-5); }
.link { color: var(--c-primary-dark); font-weight: 600; }

/* Tiny utility */
.action-bar h3 { margin-top: 0; }

/* Verified Pro badge */
.verified-pro { display: inline-block; background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-left: 8px; vertical-align: middle; }
.verified-pro-mini { display: inline-block; background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; font-size: 11px; text-align: center; vertical-align: middle; }

/* WebSocket chat status */
.chat-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-top: 4px; }
.chat-status--online { background: #dcfce7; color: #166534; }
.chat-status--connecting { background: #fef3c7; color: #92400e; }
.chat-status--warn { background: #fef3c7; color: #92400e; }
.chat-status--error { background: #fee2e2; color: #991b1b; }
.chat-typing { font-size: 12px; color: var(--c-text-muted); font-style: italic; height: 16px; visibility: hidden; margin: 4px 0; }
.meeting-cta { margin: 12px 0; padding: 12px; background: var(--c-primary-light); border-radius: var(--r-sm); text-align: center; }

