/* Mobile-first · Kanhans Family Meet 26 */
:root {
  --navy: #0c4a6e;
  --navy-deep: #082f49;
  --teal: #0f766e;
  --teal-light: #14b8a6;
  --gold: #d4a853;
  --gold-soft: #f5e6c8;
  --cream: #faf8f5;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --shadow: 0 4px 24px rgba(12, 74, 110, 0.08);
  --shadow-lg: 0 12px 40px rgba(12, 74, 110, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --touch: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-x: env(safe-area-inset-left, 0px);

  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--text);
}

/* —— Banner —— */
.banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 45%, var(--teal) 100%);
  color: #fff;
  padding: calc(1.35rem + var(--safe-top)) 1.25rem 1.5rem;
  padding-left: calc(1.25rem + var(--safe-x));
  padding-right: calc(1.25rem + var(--safe-x));
  box-shadow: var(--shadow-lg);
}

.banner-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    radial-gradient(circle at 20% 80%, var(--gold) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, var(--teal-light) 0%, transparent 40%);
  pointer-events: none;
}

.banner-inner {
  position: relative;
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
}

.banner-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0.95;
}

.banner-title {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.banner-details {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.banner-when,
.banner-where {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--gold-soft);
}

.banner-when {
  font-weight: 600;
}

.banner-where {
  margin-top: 0.35rem;
  font-weight: 500;
  opacity: 0.95;
}

/* —— Layout —— */
.app {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(1.5rem + var(--safe-bottom));
  padding-left: calc(1rem + var(--safe-x));
  padding-right: calc(1rem + var(--safe-x));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.section-lede {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.card form {
  margin-top: 1rem;
}

.field {
  display: block;
  margin-bottom: 0.85rem;
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  min-height: var(--touch);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.fieldset {
  border: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.fieldset .field-label {
  margin-bottom: 0.5rem;
}

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

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch);
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.choice:has(input:checked) {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
}

.choice input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--teal);
}

.attendee-panel {
  margin-bottom: 0.5rem;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--border);
}

.attendee-panel[hidden] {
  display: none;
}

.panel-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.panel-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pill-yes {
  background: rgba(15, 118, 110, 0.15);
  color: var(--teal);
}

.pill-no {
  background: #f1f5f9;
  color: var(--text-muted);
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.actions .btn {
  width: 50%;
  min-height: calc(var(--touch) * 1);
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, var(--teal) 0%, #0d9488 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #0d9488 0%, var(--teal) 100%);
}

.btn-secondary {
  background: var(--cream);
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.status {
  margin: 0.75rem 0 0;
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.status.error {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 500;
}

.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.list-head .section-lede {
  margin-top: 0.2rem;
}

.badge {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--gold-soft);
  border-radius: 999px;
  border: 1px solid rgba(212, 168, 83, 0.4);
}

/* —— Guest cards (mobile list) —— */
.user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.user-card {
  list-style: none;
}

.user-card-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.user-card-btn:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.12);
}

.user-card-btn:active {
  transform: scale(0.99);
}

.user-card-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.user-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-card-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.user-card-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-card-chevron {
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--teal);
  line-height: 1;
  opacity: 0.85;
}

.user-list-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.app-footer {
  text-align: center;
  padding: 1rem 1rem calc(1.25rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.app-footer p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* —— Edit modal (bottom sheet) —— */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(8, 47, 73, 0.45);
  backdrop-filter: blur(4px);
  cursor: pointer;
  animation: modal-fade-in 0.25s ease;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 28rem;
  max-height: min(92dvh, 640px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 40px rgba(12, 74, 110, 0.2);
  padding: 0.5rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  animation: modal-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-handle {
  width: 2.5rem;
  height: 4px;
  margin: 0.35rem auto 0.65rem;
  border-radius: 999px;
  background: var(--border);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.modal-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
}

.modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--gold-soft);
}

.modal-form {
  display: flex;
  flex-direction: column;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.modal-actions .btn {
  width: 100%;
  min-height: calc(var(--touch) * 0.85);
}

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

@keyframes modal-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .app {
    max-width: 32rem;
    padding-top: 1.25rem;
  }

  .banner {
    padding-bottom: 1.75rem;
  }

  .banner-title {
    font-size: 1.85rem;
  }

  .modal {
    align-items: center;
    padding: 1rem;
  }

  .modal-sheet {
    border-radius: var(--radius);
    max-height: 85dvh;
  }

  .modal-handle {
    display: none;
  }
}
