/* =========================================================
   StayMate — Design System
   Palette: deep pine ink, warm plaster paper, brass accent,
   soft sage for success, brick for errors.
   Display face: Fraunces (warmth + hospitality character)
   Body face: Inter
   Utility/mono face: JetBrains Mono (wifi codes, slugs)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --ink: #202a24;
  --ink-soft: #4b554e;
  --paper: #f3eee3;
  --paper-raised: #fffdf8;
  --line: #ddd4c1;
  --brass: #a9793c;
  --brass-dark: #8a6230;
  --teal: #1f4a44;
  --teal-dark: #16332e;
  --sage: #dde5d8;
  --sage-ink: #37543c;
  --error: #b3432b;
  --error-bg: #f7e6e0;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 1px 2px rgba(32, 42, 36, 0.06), 0 8px 24px rgba(32, 42, 36, 0.06);
  --shadow-pop: 0 12px 32px rgba(32, 42, 36, 0.16);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-width: 0;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--teal); }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- focus & accessibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- top nav (marketing + host app) ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1080px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a, .nav-links button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-links a:hover, .nav-links a.active, .nav-links button:hover {
  background: var(--sage);
  color: var(--teal-dark);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }

.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover:not(:disabled) { background: var(--brass-dark); }

.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover:not(:disabled) { background: var(--sage); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--line); }

.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover:not(:disabled) { background: var(--error-bg); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 0.85rem; }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.field .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
.field .error-text {
  font-size: 0.82rem;
  color: var(--error);
  margin-top: 6px;
  display: none;
}
.field.has-error .error-text { display: block; }
.field.has-error input,
.field.has-error textarea { border-color: var(--error); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 24px;
}
@media (min-width: 720px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 22px;
}
.form-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.form-section h3 { margin-bottom: 4px; }
.form-section .section-desc { font-size: 0.85rem; margin-bottom: 16px; }

.auth-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: var(--shadow-card);
}
.auth-card h1 { font-size: 1.6rem; }
.auth-foot { margin-top: 18px; font-size: 0.9rem; text-align: center; color: var(--ink-soft); }

/* ---------- alerts / banners ---------- */
.banner {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
  align-items: flex-start;
  gap: 8px;
}
.banner.show { display: flex; }
.banner-error { background: var(--error-bg); color: var(--error); border: 1px solid #e3b6a8; }
.banner-success { background: var(--sage); color: var(--sage-ink); border: 1px solid #b9cbb0; }
.banner-info { background: #eef2f7; color: #2b4a63; border: 1px solid #c8d7e6; }

/* ---------- dashboard ---------- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 24px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat-card .stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
}
.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.property-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.property-card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--sage) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-ink);
  font-family: var(--font-display);
}
.property-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.property-card .body h3 { margin-bottom: 0; }
.property-card .address { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 10px; }
.property-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--paper-raised);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

/* ---------- modal (delete confirm) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(32,42,36,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--paper-raised);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-pop);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--teal-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- landing page ---------- */
.hero-landing {
  padding: 70px 0 50px;
  text-align: center;
}
.hero-landing .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-dark);
  margin-bottom: 14px;
  display: inline-block;
}
.hero-landing p.lead {
  max-width: 560px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin: 50px 0;
}
.feature-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
}
.feature-card .num {
  font-family: var(--font-mono);
  color: var(--brass);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

footer.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* =========================================================
   GUEST PAGE — signature element: the "key-folio" hero.
   A hotel key-card / welcome-folio shape: rounded card with a
   die-cut circular notch top-left, on a deep teal backdrop.
   ========================================================= */

.guest-body {
  background: var(--teal-dark);
  min-height: 100vh;
}

.guest-wrap {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(0,0,0,0.35);
}

.folio-hero {
  position: relative;
  background: var(--teal);
  color: #fff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.folio-hero .cover-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--sage);
}
.folio-hero .cover-fallback {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: rgba(255,255,255,0.55);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.folio-notch {
  position: absolute;
  top: 18px; left: 18px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--teal-dark);
  border: 3px solid rgba(255,255,255,0.7);
}
.folio-brand {
  position: absolute;
  top: 22px; right: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  background: rgba(20,30,26,0.55);
  color: #fff;
  padding: 6px 10px;
  border-radius: 20px;
}
.folio-info {
  padding: 22px 22px 26px;
}
.folio-info h1 { color: #fff; margin-bottom: 6px; }
.folio-info .address { color: rgba(255,255,255,0.78); font-size: 0.92rem; margin-bottom: 0; }

.guest-desc {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.quick-actions {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.quick-actions h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  color: var(--brass-dark);
  margin-bottom: 14px;
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink);
  min-height: 44px;
}
.quick-btn:hover { border-color: var(--brass); background: var(--sage); }
.quick-btn .icon { font-size: 1.4rem; }

.chat-section {
  padding: 22px;
}
.chat-section h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  color: var(--brass-dark);
  margin-bottom: 14px;
}
.chat-window {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 220px;
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.assistant {
  background: var(--sage);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  background: var(--teal);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.error-msg {
  background: var(--error-bg);
  color: var(--error);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg.typing { display: flex; gap: 4px; align-items: center; }
.chat-msg.typing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sage-ink);
  animation: typing-bounce 1.1s infinite ease-in-out;
}
.chat-msg.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.chat-msg.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1;
}
.chat-form button {
  flex-shrink: 0;
}

.guest-foot {
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- 404 / state pages ---------- */
.state-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.state-page .state-code {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--brass);
  margin-bottom: 8px;
}

/* ---------- utility ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: rgba(32,42,36,0.25);
  border-top-color: var(--teal);
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

.upload-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--line);
  margin-top: 10px;
  display: none;
  background: var(--sage);
}
.upload-preview.show { display: block; }

.char-count {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: right;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .auth-card { margin: 30px auto; padding: 26px 20px; }
  .folio-info h1 { font-size: 1.5rem; }
}
