:root {
  /* Sonoran Twilight Palette */
  --bg: #1a0f21; /* Deep Plum */
  --card: rgba(61, 38, 71, 0.65); /* Muted Amethyst with transparency */
  --ink: #fdf2f8; /* Crisp off-white/pink for text */
  --muted: #bda4c4; /* Soft lavender for secondary text */
  --line: rgba(244, 152, 156, 0.2); /* Saguaro pink, muted for borders */
  
  --accent: #f5b041; /* Desert Marigold for primary buttons */
  --accent-strong: #d69833; 
  --accent-contrast: #1a0f21; /* Dark text on bright buttons */
  
  --teal: #f4989c; /* Re-mapped to Saguaro Blossom Pink for focus states */
  --teal-soft: rgba(244, 152, 156, 0.15); 
  
  /* Status Colors */
  --sunset: #8c4243;
  --ok: #48c9b0; /* Turquoise Mint for available days */
  --warn: #f5b041;
  --bad: #e07a5f;
  
  /* The Desert Heat Haze Glow */
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.3), 0 0 40px -10px rgba(245, 176, 65, 0.12);
  
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }

/* Updated Background Gradient */
body {
  margin: 0; min-height: 100vh;
  background: linear-gradient(180deg, #1a0f21 0%, #4c2241 60%, #8c4243 100%);
  background-attachment: fixed; /* Keeps the sunset fixed while scrolling */
}

/* Glassmorphism Cards */
.card { 
  background: var(--card); 
  border: 1px solid var(--line); 
  border-radius: 20px; 
  box-shadow: var(--shadow); 
  padding: 18px; 
  margin: 14px 0; 
  backdrop-filter: blur(16px); 
  -webkit-backdrop-filter: blur(16px);
}

/* Dark Mode Form Inputs */
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 12px;
  background: rgba(0, 0, 0, 0.25) !important; /* Semi-transparent dark background */
  color: var(--ink) !important;
  color-scheme: dark; /* Forces native date pickers/scrollbars to dark mode */
}

/* === QUICK WIN 1: Styled Date Pickers === */
input[type="date"] {
  font-family: inherit;
  font-weight: 700;
  color: var(--accent); /* Makes the selected dates pop in Marigold */
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
input::placeholder, textarea::placeholder {
  color: var(--muted);
}

/* === QUICK WIN 2: Interactive Calendar Hover === */
.public-calendar .calendar-day {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); /* Springy transition */
}
.public-calendar .calendar-day:not(.empty):hover { 
  transform: translateY(-4px) scale(1.02); 
  border-color: var(--teal); 
  box-shadow: 0 8px 20px -5px rgba(244, 152, 156, 0.4);
  background: rgba(244, 152, 156, 0.1);
  z-index: 2;
}

/* === QUICK WIN 3: Custom Checkbox === */
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; 
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  background: rgba(26, 15, 33, 0.5);
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}
.check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check input[type="checkbox"]:checked::after {
  content: "✔";
  position: absolute;
  color: var(--accent-contrast);
  font-size: 14px;
  font-weight: 900;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

a { color: var(--accent-strong); }
::selection { background: var(--teal-soft); }
.container { width: min(960px, 100%); margin: 0 auto; padding: 18px; }
.hero { padding: 22px 0 12px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.1; }
h1 { font-size: clamp(2rem, 7vw, 4rem); }
h2 { font-size: 1.3rem; }
p { line-height: 1.45; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }
.grid { display: grid; gap: 12px; }
.two { grid-template-columns: 1fr; }
@media (min-width: 720px) { .two { grid-template-columns: 1fr 1fr; } }
label { display: grid; gap: 7px; font-weight: 700; color: var(--ink); font-size: .94rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 12px;
  background: #fff; color: var(--ink); outline: none;
}
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 111, 120, .16); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.check input { width: auto; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 46px; border: 0; border-radius: 999px; padding: 12px 16px;
  background: var(--accent); color: var(--accent-contrast); font-weight: 800; text-decoration: none;
  cursor: pointer;
}
button.secondary, .button.secondary { background: rgba(245, 176, 65, 0.15) !important; color: var(--accent-strong) !important; }
button.ghost, .button.ghost { background: transparent !important; color: var(--accent) !important; border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button:disabled { opacity: .58; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.status { padding: 10px 12px; border-radius: 14px; background:rgba(245, 176, 65, 0.1) !important; color: var(--accent-strong);; font-weight: 800; }
.status.ok { background: rgba(72, 201, 176, 0.1) !important; color: var(--ok); }
.status.warn { background: rgba(245, 176, 65, 0.1) !important; color: var(--warn); }
.status.bad { background: rgba(224, 122, 95, 0.15) !important; color: var(--bad); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.list { display: grid; gap: 12px; }
.item { border: 1px solid var(--line); background: rgba(0,0,0,0.2); border-radius: 16px; padding: 14px; }item { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 14px; }
.item header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pill { background: #f2ece5; border-radius: 999px; padding: 6px 10px; color: var(--muted); font-weight: 700; font-size: .86rem; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; position: sticky; top: 0; background: rgba(26, 15, 33, 0.85) !important; backdrop-filter: blur(8px); z-index: 2; border-bottom: 1px solid var(--line)}
.tabs button { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; }
.section { scroll-margin-top: 70px; }
pre.message { white-space: pre-wrap; background: #2f241d; color: #fffaf2; padding: 12px; border-radius: 14px; overflow: auto; }
.footer { padding: 24px 0 40px; color: var(--muted); text-align: center; }
.notice { border-left: 5px solid var(--accent); padding-left: 12px; }
.section-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.calendar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.calendar-controls strong { flex: 1 1 180px; text-align: center; font-size: 1.05rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-weekday { text-align: center; color: var(--muted); font-size: .78rem; font-weight: 800; padding: 6px 0; }
.calendar-day {
  display: grid; align-content: start; justify-content: stretch; gap: 4px; min-height: 72px;
  border: 1px solid var(--line); border-radius: 14px; padding: 7px;
  background: rgba(0,0,0,0.2); color: var(--ink); text-align: left;
}
.calendar-day.empty { background: transparent; border: 0; box-shadow: none; }
.calendar-day.selected { outline: 3px solid rgba(31, 111, 120, .18); border-color: var(--teal); }
.calendar-day.booked { background: #e8f3e8; }
.calendar-day.pending { background: #fff4dc; }
.calendar-day.blocked { background: #f8e1dc; }
.calendar-number { font-weight: 900; line-height: 1; }
.calendar-tags { display: grid; gap: 3px; }
.calendar-tag { display: block; width: fit-content; border-radius: 999px; padding: 2px 5px; font-size: .66rem; font-weight: 800; color: var(--muted); background: rgba(0, 0, 0, 0.4) !important; }
.calendar-tag.booked { color: var(--ok); }
.calendar-tag.pending { color: var(--warn); }
.calendar-tag.blocked { color: var(--bad); }
.calendar-day-list { margin-top: 12px; display: grid; gap: 8px; }
.mini-item { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(0,0,0,0.2); }
.mini-item.booked { border-left: 5px solid var(--ok); }
.mini-item.pending { border-left: 5px solid var(--warn); }
.mini-item.blocked { border-left: 5px solid var(--bad); }
@media (max-width: 520px) {
  .calendar-grid { gap: 4px; }
  .calendar-day { min-height: 58px; padding: 5px; border-radius: 10px; }
  .calendar-tag { font-size: .57rem; padding: 1px 4px; }
}
.hero-with-icon { display: flex; align-items: center; gap: 14px; }
.app-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); flex: 0 0 auto; }
.tab-link { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; }
.copy-box {
  display: grid; gap: 10px; align-items: center;
  grid-template-columns: minmax(0, 1fr); margin-top: 10px;
}
.copy-box span {
  display: block; overflow-wrap: anywhere; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; color: var(--muted); font-size: .9rem;
}
.settings-form { gap: 16px; }
.settings-card {
  display: grid; gap: 12px; border: 1px solid var(--line); background: rgb(244, 152, 156, 0.1);
  border-radius: 18px; padding: 14px;
}
.help-card ol { margin: 0; padding-left: 1.35rem; color: var(--muted); line-height: 1.55; }
.help-card li + li { margin-top: 6px; }
@media (min-width: 720px) {
  .copy-box { grid-template-columns: minmax(0, 1fr) auto auto; }
  .app-icon { width: 88px; height: 88px; border-radius: 22px; }
}
@media (max-width: 520px) {
  .hero-with-icon { align-items: flex-start; }
  .app-icon { width: 58px; height: 58px; border-radius: 15px; }
}
.compact-label { display: grid; gap: 5px; min-width: 160px; font-weight: 800; color: var(--muted); }
.compact-label select { min-height: 42px; }
.export-actions a { text-align: center; }
.reservation-detail header { align-items: center; }
.reservation-detail .status { white-space: nowrap; }
@media (max-width: 620px) {
  .section-header { display: grid; }
  .compact-label { width: 100%; }
  .export-actions .button { width: 100%; }
}


/* Phase G: public availability calendar and Arizona UI polish */
.hero h1 { letter-spacing: -.04em; }
.hero p { max-width: 62ch; }
.card.availability-card,
.card.request-card {
  border-color: rgba(184, 92, 56, .22);
}
.availability-card {
  position: relative;
  overflow: hidden;
}
.availability-card::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -62px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(232,162,77,.25), rgba(232,162,77,0) 68%);
  pointer-events: none;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}
.calendar-legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.legend-dot.available { background: #fff; }
.legend-dot.booked { background: #e8f3e8; }
.legend-dot.unavailable { background: #f8e1dc; }
.public-calendar .calendar-day {
  min-height: 78px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.public-calendar .calendar-day:not(.empty):hover { transform: translateY(-1px); border-color: var(--teal); }
.public-calendar .calendar-tag.available { color: var(--ok); }
.public-calendar .calendar-tag.booked,
.public-calendar .calendar-tag.pending { color: var(--accent-strong); }
.public-calendar .calendar-tag.unavailable { color: var(--bad); }
.public-calendar .calendar-day.booked .calendar-tag,
.public-calendar .calendar-day.blocked .calendar-tag { background: rgba(0, 0, 0, 0.6) !important;; }
.calendar-off .public-calendar { opacity: .55; }
#dateConflictStatus { margin: 0; }
.request-card button[type="submit"] { min-height: 52px; }
.settings-card h3 { color: var(--teal); }
@media (max-width: 520px) {
  .container { padding: 14px; }
  .public-calendar .calendar-day { min-height: 64px; }
  .public-calendar .calendar-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-controls button { flex: 1 1 auto; }
}


