:root {
  --bg: #f0f6ff;
  --card-bg: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0ea5e9;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --selected: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #e0f2fe 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 2.2rem;
}

.tagline {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.card h2 {
  margin-top: 0;
}

/* Generic utility */
.hidden {
  display: none;
}

/* Landing: "or" divider between the two options */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider span {
  padding: 0 0.75rem;
}

/* Inline form errors */
.form-error {
  margin: 0.75rem 0 0;
  color: #b91c1c;
  font-size: 0.9rem;
}

/* Trip header / share */
.home-link {
  color: var(--muted);
  text-decoration: none;
}

.home-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.share-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.trip-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary-dark);
  background: #fff;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
}

.field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

.field label {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="number"] {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #eff6ff;
  color: var(--primary-dark);
  border: 1px solid #bfdbfe;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}

.secondary-btn:hover {
  background: #dbeafe;
}

.text-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
}

.text-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

.selected-summary {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-sub {
  color: var(--muted);
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
}

/* Best dates summary */
.best-dates {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.best-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 4px solid var(--border);
}

.best-row.top {
  border-left-color: var(--accent);
  background: #f0f9ff;
}

.best-row.everyone {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.best-date {
  font-weight: 700;
}

.best-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Responses list */
.responses {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.response-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.response-item .response-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.response-item .response-name {
  font-weight: 700;
}

.response-item .response-party {
  color: var(--muted);
  font-size: 0.9rem;
}

.response-details {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Budget input with a $ prefix */
.budget-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.budget-input:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.budget-prefix {
  padding: 0 0.6rem;
  color: var(--muted);
  background: #f8fafc;
  align-self: stretch;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}

.budget-input input {
  border: none;
  flex: 1;
}

.budget-input input:focus {
  outline: none;
}

.response-dates {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.date-chip {
  background: #eff6ff;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
}

.remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.remove-btn:hover {
  text-decoration: underline;
}

/* Calendar modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.overlay.hidden {
  display: none;
}

.calendar-modal {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.month-label {
  font-weight: 700;
  font-size: 1.05rem;
}

.nav-btn {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.nav-btn:hover {
  background: #e2e8f0;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday-row {
  margin-bottom: 4px;
}

.weekday-row span {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  padding: 0.25rem 0;
}

.day {
  aspect-ratio: 1 / 1;
  border: none;
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.day:hover {
  background: #e2e8f0;
}

.day.empty {
  background: transparent;
  cursor: default;
}

.day.past {
  color: #cbd5e1;
  cursor: not-allowed;
}

.day.past:hover {
  background: #f8fafc;
}

.day.selected {
  background: var(--selected);
  color: #fff;
  font-weight: 700;
}

.calendar-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}
