:root {
  --bg: #f5f2ed;
  --surface: #ffffff;
  --surface2: #f0ece5;
  --text: #1a1714;
  --text2: #6b6560;
  --text3: #a09890;
  --accent: #2d6a4f;
  --accent2: #40916c;
  --accent-light: #d8f3dc;
  --danger: #c1121f;
  --danger-light: #ffe5e5;
  --warn: #e07b00;
  --warn-light: #fff3cd;
  --border: rgba(26,23,20,0.12);
  --border2: rgba(26,23,20,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(26,23,20,0.08);
  --shadow-lg: 0 8px 40px rgba(26,23,20,0.14);
  --font: 'DM Sans', sans-serif;
  --font-display: 'DM Serif Display', serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-logo span { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-name { font-size: 14px; color: var(--text2); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--surface2); text-decoration: none; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #a30f19; border-color: #a30f19; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 5px; color: var(--text2);
}
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); background: white; }
.form-input::placeholder { color: var(--text3); }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: block; }
.form-error-box {
  background: var(--danger-light); border: 1px solid rgba(193,18,31,.2);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: var(--danger); font-size: 13px; margin-top: .5rem;
}

/* ── AUTH ── */
.auth-wrapper {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
}
.auth-title { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: .3rem; }
.auth-subtitle { color: var(--text2); margin-bottom: 1.8rem; font-size: 14px; }

/* ── DASHBOARD ── */
.dashboard-wrap { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }
.dashboard-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 2rem; gap: 1rem;
}
.dashboard-title { font-family: var(--font-display); font-size: 1.6rem; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none; color: var(--text);
  display: block;
  transition: all 0.15s;
}
.plan-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.plan-card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.plan-card-desc { color: var(--text2); font-size: 13px; margin-bottom: 12px; line-height: 1.4; }
.plan-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.plan-card-date { font-size: 12px; color: var(--text3); margin-top: 8px; }

.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); grid-column: 1/-1;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-green { background: var(--accent-light); color: var(--accent); }
.badge-gray { background: var(--surface2); color: var(--text2); }

/* ── WIZARD ── */
.wizard-wrap { max-width: 860px; margin: 0 auto; padding: 2.5rem 2rem; }
.wizard-header { margin-bottom: 1.5rem; }
.wizard-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text2); font-size: 14px; margin-bottom: .8rem;
  background: none; border: none; padding: 0; cursor: pointer;
}
.wizard-back:hover { color: var(--text); }
.wizard-title { font-family: var(--font-display); font-size: 1.8rem; }

.wizard-steps {
  display: flex; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); margin-bottom: 2rem;
}
.wizard-step {
  flex: 1; padding: 11px 14px; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--text2);
  border-right: 1px solid var(--border);
}
.wizard-step:last-child { border-right: none; }
.wizard-step.active { background: var(--accent-light); color: var(--accent); }
.wizard-step.done { background: var(--accent); color: white; }

.wizard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.wizard-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.2rem; }
.wizard-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 1.8rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

/* ── CALENDAR ── */
.cal-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .8rem;
}
.cal-nav-title { font-weight: 600; font-size: 15px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-header-day {
  text-align: center; font-size: 11px; font-weight: 500;
  color: var(--text3); padding: 5px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.1s;
  border: 1.5px solid transparent;
}
.cal-day:hover:not(.empty):not(.past) { background: var(--accent-light); color: var(--accent); }
.cal-day.selected { background: var(--accent); color: white; }
.cal-day.empty { cursor: default; }
.cal-day.past { color: var(--text3); cursor: default; }
.cal-day.today { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cal-day.selected.today { color: white; }

/* ── SLOT PICKER ── */
.slot-date-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.slot-date-tab {
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px; background: var(--surface);
  cursor: pointer; transition: all 0.1s;
}
.slot-date-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.time-grid {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 2px;
  user-select: none;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.time-label {
  font-size: 11px; color: var(--text3);
  display: flex; align-items: flex-start;
  padding-top: 3px; padding-right: 8px;
  justify-content: flex-end;
}
.time-slot {
  height: 26px;
  background: var(--surface2);
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: crosshair;
  transition: background 0.08s;
}
.time-slot:hover { background: var(--accent-light); }
.time-slot.selected { background: var(--accent); border-color: var(--accent2); }
.drag-hint { font-size: 12px; color: var(--text3); text-align: center; padding: 6px; margin-top: 4px; }

/* ── SHARE ── */
.share-link-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; font-family: monospace; word-break: break-all;
}
.share-link-box span { flex: 1; color: var(--text2); }

/* ── RESPOND ── */
.respond-wrap { max-width: 820px; margin: 0 auto; padding: 2.5rem 2rem; }
.respond-wrap-wide { max-width: 100%; margin: 0 auto; padding: 2.5rem 2rem; }
.respond-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 2rem;
  margin-bottom: 1.2rem; box-shadow: var(--shadow);
}
.respond-plan-title { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: .3rem; }
.respond-plan-desc { color: var(--text2); font-size: 14px; }

.success-banner {
  background: var(--accent-light); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 1rem 1.5rem;
  margin-bottom: 1.2rem; color: var(--accent);
}

.outlook-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
}
.outlook-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem;
}
.outlook-title {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.outlook-event {
  display: flex; gap: 10px; align-items: center;
  padding: 6px 10px; border-radius: var(--radius-sm);
  border-left: 3px solid #0078d4; background: #eef5fd;
  font-size: 13px; margin-bottom: 4px;
}
.outlook-event-time { color: var(--text2); min-width: 120px; font-size: 12px; }

.participant-form {
  background: var(--accent-light); border: 1px solid rgba(45,106,79,.25);
  border-radius: var(--radius); padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
}
.participant-form h3 { font-size: 14px; font-weight: 600; margin-bottom: .3rem; color: var(--accent); }

.slot-respond-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.4rem;
  margin-bottom: .75rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  transition: box-shadow 0.15s;
}
.slot-respond-card:hover { box-shadow: var(--shadow); }
.slot-info { flex: 1; min-width: 140px; }
.slot-date-label { font-weight: 600; font-size: 14px; }
.slot-time-label { color: var(--text2); font-size: 13px; }
.slot-stats { display: flex; gap: 5px; flex-wrap: wrap; }
.resp-count {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 2px 7px; border-radius: 20px;
}
.resp-yes { background: var(--accent-light); color: var(--accent); }
.resp-maybe { background: var(--warn-light); color: var(--warn); }
.resp-no { background: var(--danger-light); color: var(--danger); }

.response-btns { display: flex; gap: 5px; }
.resp-btn {
  padding: 6px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 500;
  background: var(--surface); cursor: pointer;
  transition: all 0.15s; font-family: var(--font);
}
.resp-btn:hover { background: var(--surface2); transform: translateY(-1px); }
.active-yes { background: var(--accent) !important; color: white !important; border-color: var(--accent) !important; }
.active-no { background: var(--danger) !important; color: white !important; border-color: var(--danger) !important; }
.active-maybe { background: var(--warn) !important; color: white !important; border-color: var(--warn) !important; }

/* ── PLAN DETAIL ── */
.plan-detail-wrap { max-width: 1000px; margin: 0 auto; padding: 2.5rem 2rem; }
.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.8rem; gap: 1rem; flex-wrap: wrap;
}
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}

.results-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.results-table th {
  text-align: left; padding: 9px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  font-weight: 500; color: var(--text2); white-space: nowrap;
}
.results-table td {
  padding: 9px 12px; border: 1px solid var(--border);
  background: var(--surface); vertical-align: middle;
}
.results-table tr.result-best td { background: #f0faf4; }
.th-yes { background: var(--accent-light) !important; color: var(--accent) !important; }
.th-maybe { background: var(--warn-light) !important; color: var(--warn) !important; }
.th-no { background: var(--danger-light) !important; color: var(--danger) !important; }
.count-yes { color: var(--accent); font-weight: 600; text-align: center; }
.count-maybe { color: var(--warn); font-weight: 600; text-align: center; }
.count-no { color: var(--danger); font-weight: 600; text-align: center; }
.names-cell { font-size: 12px; color: var(--text2); }
.name-group { display: inline-block; margin-right: 6px; }
.yes-names { color: var(--accent); }
.maybe-names { color: var(--warn); }

/* ── TOGGLE SWITCH ── */
.toggle-switch { position: relative; width: 38px; height: 22px; display: inline-block; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0; background: var(--border);
  border-radius: 22px; transition: .2s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 2rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; }

/* ── GLOBAL TOAST ── */
.global-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease; max-width: 320px;
}
.global-toast.success { background: var(--accent); color: white; }
.global-toast.error { background: var(--danger); color: white; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── UTILS ── */
.section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3); margin-bottom: .6rem;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 1.4rem 0; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text2); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .wizard-wrap, .dashboard-wrap, .respond-wrap, .plan-detail-wrap { padding: 1.5rem 1rem; }
  .auth-card { padding: 1.5rem; }
  .wizard-step { font-size: 11px; padding: 8px 6px; }
  .slot-respond-card { flex-direction: column; align-items: flex-start; }
  .response-btns { width: 100%; }
  .resp-btn { flex: 1; justify-content: center; }
  .detail-header { flex-direction: column; }
  .results-table { font-size: 12px; }
}

/* ── Language Switcher ───────────────────────────────────── */
.lang-switcher { position:relative; }
.lang-btn { display:inline-flex; align-items:center; gap:4px; padding:5px 8px; font-size:12px; }
.lang-flag { font-size:15px; line-height:1; }
.lang-code { font-weight:600; }
.lang-menu {
  position:absolute; right:0; top:calc(100% + 4px);
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
  min-width:140px; z-index:200; overflow:hidden;
}
.lang-option {
  display:flex; align-items:center; gap:8px;
  width:100%; padding:8px 12px; border:none; background:none;
  cursor:pointer; font-family:var(--font); font-size:13px;
  color:var(--text); text-align:left;
  transition:background .1s;
}
.lang-option:hover { background:var(--surface2); }
.lang-active { background:var(--accent-light); color:var(--accent); font-weight:600; }

/* ── Page layout with ad sidebar ──────────────────────────── */
.page-wrap {
  display: block;
  min-height: calc(100vh - 60px - 44px); /* nav + footer */
}
.page-wrap-ads {
  display: grid;
  grid-template-columns: 18% 1fr;
  align-items: start;
}
@@media (max-width: 960px) {
  /* Hide sidebar on mobile – AdSense anchor ads handle mobile */
  .page-wrap-ads {
    grid-template-columns: 1fr;
  }
  .ad-sidebar { display: none; }
}

/* Ad sidebar */
.ad-sidebar {
  position: sticky;
  top: 68px; /* nav height + gap */
  min-height: 100px;
  padding: 1rem .75rem;
}
.ad-sidebar-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  text-align: center;
}
.ad-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: .5rem;
}
.ad-unit {
  display: block;
  width: 100%;
  min-height: 250px;
}

/* Global footer */
.global-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: 44px;
  display: flex;
  align-items: center;
}
.global-footer-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.global-footer-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 12px;
  color: var(--text3);
}
.global-footer-logo {
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--accent);
}
.global-footer-logo span { color: var(--text3); }
.global-footer-sep { color: var(--text3); }
.global-footer-brand a { color: var(--text2); font-weight: 500; }
.global-footer-links {
  display: flex;
  gap: 1.25rem;
  font-size: 12px;
}
.global-footer-links a {
  color: var(--text3);
  text-decoration: none;
  transition: color .1s;
}
.global-footer-links a:hover { color: var(--accent); }
@@media (max-width: 500px) {
  .global-footer-inner { flex-direction: column; height: auto; padding: .5rem 1rem; }
  .global-footer { height: auto; }
}
