/* WAPP — Wayne Coffee Design System */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700;800&family=Barlow:wght@300;400;500;600&display=swap');

/* ─── Design Tokens ─────────────────────────────────── */
:root {
  /* Palette — Wayne identity */
  --cream:        #F5F0E8;
  --cream-dark:   #EDE7D9;
  --ink:          #1A1A1A;
  --ink-light:    #3D3D3D;
  --ink-muted:    #6B6B6B;
  --gold:         #C9A84C;
  --gold-light:   #E8D28A;
  --gold-dark:    #A07C2A;
  --rust:         #8B3A2F;
  --rust-light:   #C05540;
  --white:        #FFFFFF;
  --success:      #2D7A4F;
  --success-bg:   #E8F5EE;
  --warning:      #B07D1A;
  --warning-bg:   #FDF3DC;
  --danger:       #C0392B;
  --danger-bg:    #FDECEA;

  /* Typography */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Radii */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(26,26,26,.08);
  --shadow-md:  0 4px 16px rgba(26,26,26,.10);
  --shadow-lg:  0 8px 32px rgba(26,26,26,.14);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur:  200ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-display { font-size: clamp(36px, 8vw, 56px); font-weight: 800; }
.text-h1      { font-size: clamp(28px, 6vw, 40px); font-weight: 700; }
.text-h2      { font-size: clamp(22px, 4vw, 30px); font-weight: 700; }
.text-h3      { font-size: 20px; font-weight: 600; }
.text-h4      { font-size: 17px; font-weight: 600; }
.text-body    { font-size: 15px; font-weight: 400; }
.text-small   { font-size: 13px; font-weight: 400; }
.text-micro   { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

.text-gold    { color: var(--gold); }
.text-muted   { color: var(--ink-muted); }
.text-rust    { color: var(--rust); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-full);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--ink-light); box-shadow: var(--shadow-md); }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: var(--gold-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(26,26,26,.2);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(26,26,26,.04); }

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

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: 13px; }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: 17px; }
.btn-full { width: 100%; }

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,26,26,.06);
}

.card-sm { padding: var(--sp-4); border-radius: var(--r-md); }
.card-flush { padding: 0; overflow: hidden; }

/* ─── Inputs ─────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.input-label { font-size: 13px; font-weight: 600; color: var(--ink-light); letter-spacing: 0.02em; }

.input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid rgba(26,26,26,.15);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}

.input::placeholder { color: var(--ink-muted); }

textarea.input { resize: vertical; min-height: 80px; }

/* ─── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-gold    { background: var(--gold-light); color: var(--gold-dark); }
.badge-ink     { background: var(--ink); color: var(--cream); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-muted   { background: rgba(26,26,26,.08); color: var(--ink-muted); }

/* ─── Avatar ─────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--gold-light);
  color: var(--gold-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }

/* ─── Divider ────────────────────────────────────────── */
.divider {
  height: 1px;
  background: rgba(26,26,26,.08);
  margin: var(--sp-4) 0;
}

/* ─── Spinner ────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(26,26,26,.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  width: min(360px, 90vw);
}

.toast {
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 250ms var(--ease) forwards;
  pointer-events: all;
}

.toast-success { background: var(--ink); color: var(--cream); }
.toast-error   { background: var(--danger); color: var(--white); }
.toast-info    { background: var(--gold); color: var(--ink); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Stat card ──────────────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(26,26,26,.06);
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-1);
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: var(--sp-1);
}

/* ─── Progress bar ───────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: rgba(26,26,26,.08);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--gold);
  transition: width 400ms var(--ease);
}

.progress-fill.danger  { background: var(--danger); }
.progress-fill.success { background: var(--success); }

/* ─── Empty state ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
  gap: var(--sp-3);
}

.empty-state .empty-icon {
  font-size: 48px;
  opacity: 0.35;
  margin-bottom: var(--sp-2);
}

.empty-state p { color: var(--ink-muted); font-size: 14px; max-width: 240px; }

/* ─── Modal ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--sp-4);
  animation: backdrop-in 200ms var(--ease);
}

@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--cream);
  border-radius: var(--r-xl) var(--r-xl) var(--r-lg) var(--r-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--sp-6);
  animation: modal-in 300ms var(--ease);
}

@keyframes modal-in {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

/* ─── Checklist item ─────────────────────────────────── */
.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--white);
  border: 1.5px solid rgba(26,26,26,.06);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checklist-item.done {
  background: var(--success-bg);
  border-color: rgba(45,122,79,.2);
}

.checklist-item.done .item-text {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.check-box {
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  border: 2px solid rgba(26,26,26,.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.checklist-item.done .check-box {
  background: var(--success);
  border-color: var(--success);
}

.check-box svg { display: none; }
.checklist-item.done .check-box svg { display: block; }

/* ─── Availability calendar ──────────────────────────── */
.avail-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-2);
}

.avail-day {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1.5px solid rgba(26,26,26,.1);
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: all var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.avail-day.available   { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.avail-day.unavailable { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); opacity: 0.7; }
.avail-day.past        { opacity: 0.35; pointer-events: none; }
.avail-day .day-num    { font-size: 16px; font-weight: 700; color: inherit; line-height: 1; }

/* ─── Notification dot ───────────────────────────────── */
.notif-dot {
  width: 8px;
  height: 8px;
  background: var(--rust);
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -2px;
  border: 1.5px solid var(--cream);
}

/* ─── Utility classes ────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.p-4  { padding: var(--sp-4); }
.p-6  { padding: var(--sp-6); }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
