/* ============================================================
   OLSEN FAMILY CHECK-IN — main.css
   Mobile-first. Paleta: bark/gold/cream/moss.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400&display=swap');

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

:root {
  --ink:    #1a1714;
  --bark:   #2e2820;
  --peat:   #4a3f35;
  --stone:  #8c7b6b;
  --sand:   #c9b99a;
  --cream:  #f5f0e8;
  --fog:    #faf8f4;
  --gold:   #b8955a;
  --gold-h: #c9a56a;
  --rust:   #8b4a2f;
  --moss:   #3d4f3a;
  --red:    #c0392b;

  --radius: 2px;
  --gap:    24px;
  --side:   20px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--fog); color: var(--ink); line-height: 1.5; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY HELPERS ───────────────────────────────── */
.mono  { font-family: 'DM Mono', monospace; }
.serif { font-family: 'Cormorant Garamond', serif; }

/* ── ─────────────────────────────────────────────────── */
/* PAGE: ENTRY (index.php / error screens)               */
/* ─────────────────────────────────────────────────────── */
.page-entry { display: flex; min-height: 100vh; background: var(--fog); }
.entry-wrap { width: 100%; display: flex; align-items: center; justify-content: center; padding: 32px var(--side); }
.entry-card { width: 100%; max-width: 400px; text-align: center; padding: 40px 32px; background: #fff; border: 1px solid #e8e2da; border-radius: var(--radius); }
.entry-brand { margin-bottom: 32px; }
.entry-brand-name { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 300; color: var(--ink); }
.entry-brand-sub { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--stone); margin-top: 4px; }
.entry-icon { font-size: 48px; margin-bottom: 20px; }
.entry-icon--error { filter: grayscale(1); opacity: .5; }
.entry-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 300; margin-bottom: 12px; color: var(--ink); }
.entry-body { font-size: 14px; color: var(--stone); line-height: 1.65; margin-bottom: 24px; }
.entry-contact { border-top: 1px solid #eee; padding-top: 20px; }
.entry-contact-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--stone); margin-bottom: 12px; }
.entry-contact-link { display: block; padding: 10px 16px; background: var(--fog); border: 1px solid #e0d8cc; border-radius: var(--radius); font-size: 13px; color: var(--peat); margin-bottom: 8px; }
.entry-contact-link:hover { background: var(--cream); text-decoration: none; }

/* ── ─────────────────────────────────────────────────── */
/* PAGE: CHECKIN (checkin.php)                           */
/* ─────────────────────────────────────────────────────── */
.page-checkin { background: var(--fog); min-height: 100vh; padding-bottom: 100px; }

/* Hero */
.hero { background: var(--bark); padding: 36px var(--side) 32px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 75% 0%, rgba(184,149,90,.2) 0%, transparent 65%);
  pointer-events: none;
}
.hero-eyebrow { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.hero-title { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 300; color: var(--cream); line-height: 1.15; margin-bottom: 8px; }
.hero-title em { font-style: italic; color: var(--sand); }
.hero-sub { font-size: 13px; color: var(--stone); font-weight: 300; }
.hero-stay { margin-top: 20px; padding: 12px 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: var(--radius); }
.hero-stay-name { font-family: 'Cormorant Garamond', serif; font-size: 17px; color: var(--cream); }
.hero-stay-detail { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--stone); letter-spacing: 1.5px; margin-top: 3px; }

/* Progress bar */
.progress { background: var(--bark); border-bottom: 1px solid rgba(255,255,255,.06); }
.progress-inner { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 var(--side); }
.progress-inner::-webkit-scrollbar { display: none; }
.progress-step { flex-shrink: 0; padding: 11px 14px; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--stone); border-bottom: 2px solid transparent; cursor: default; white-space: nowrap; transition: all .2s; user-select: none; }
.progress-step.active { color: var(--gold); border-bottom-color: var(--gold); }
.progress-step.done { color: var(--moss); border-bottom-color: var(--moss); cursor: pointer; }
.step-check { margin-right: 4px; }

/* Form */
.form-main { padding: 0; }
.form-step { display: none; padding: var(--gap) var(--side); }
.form-step.active { display: block; }

.section-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--stone); margin-bottom: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--sand); opacity: .65; }

/* Fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--peat); margin-bottom: 6px; }
.req { color: var(--rust); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  background: #fff; border: 1px solid #ddd6ca;
  border-radius: var(--radius); font-family: 'DM Sans', sans-serif;
  font-size: 15px; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,149,90,.12);
}
.field input.error, .field select.error, .field textarea.error { border-color: var(--red); }
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 12px; color: var(--stone); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-code { font-family: 'DM Mono', monospace; font-size: 28px; letter-spacing: 8px; text-align: center; }

/* Upload zone */
.upload-zone { border: 1.5px dashed #c9b99a; border-radius: var(--radius); padding: 28px 20px; text-align: center; background: #fdfbf8; cursor: pointer; transition: all .2s; position: relative; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--gold); background: #faf6ef; }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 22px; margin-bottom: 8px; opacity: .5; }
.upload-text { font-size: 13px; color: var(--stone); }
.upload-hint { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--sand); margin-top: 4px; }

/* Uploaded file pill */
.uploaded-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #edf0ec; border: 1px solid #c0d4bc; border-radius: var(--radius); margin-bottom: 8px; }
.uploaded-icon { font-size: 18px; }
.uploaded-name { flex: 1; font-size: 13px; color: var(--peat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploaded-size { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--stone); }
.uploaded-ok { color: var(--moss); font-size: 16px; }

/* Consent */
.consent-box { background: var(--cream); border: 1px solid #ddd6ca; border-radius: var(--radius); padding: 14px 16px; margin-top: 8px; }
.consent-label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.consent-label input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--gold); }
.consent-label span { font-size: 13px; color: var(--peat); line-height: 1.6; }

/* Step navigation */
.step-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 10px; padding: 14px var(--side); background: rgba(250,248,244,.96); border-top: 1px solid #e0d8cc; backdrop-filter: blur(8px); z-index: 50; }
.btn-primary { flex: 1; padding: 14px 20px; background: var(--gold); border: none; border-radius: var(--radius); cursor: pointer; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink); transition: background .2s; }
.btn-primary:hover { background: var(--gold-h); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { padding: 14px 20px; background: transparent; border: 1px solid #d0c8bc; border-radius: var(--radius); cursor: pointer; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--stone); }
.btn-full { width: 100%; }

/* Toast */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); min-width: 240px; max-width: calc(100% - 40px); padding: 12px 20px; border-radius: var(--radius); font-size: 13px; text-align: center; z-index: 200; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.success { background: var(--moss); color: #fff; }
.toast.error { background: var(--red); color: #fff; }

/* ── PAGE: DONE ────────────────────────────────────────── */
.page-done { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--fog); }
.done-wrap { text-align: center; padding: 40px var(--side); }
.done-icon { font-size: 56px; margin-bottom: 24px; }
.done-title { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 300; color: var(--ink); line-height: 1.15; margin-bottom: 16px; }
.done-title em { font-style: italic; color: var(--gold); }
.done-body { font-size: 14px; color: var(--stone); line-height: 1.7; margin-bottom: 24px; }
.done-detail { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--sand); margin-bottom: 28px; }
.done-wa { display: inline-block; padding: 12px 24px; background: #25d366; color: #fff; border-radius: var(--radius); font-size: 13px; font-weight: 500; }
.done-wa:hover { text-decoration: none; background: #1ebe58; }

/* ── PAGE: LOGIN ───────────────────────────────────────── */
.page-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.login-wrap { width: 100%; padding: 24px var(--side); }
.login-card { max-width: 380px; margin: 0 auto; background: var(--fog); border-radius: var(--radius); padding: 40px 32px; }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand-name { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 300; color: var(--ink); }
.login-brand-sub { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--stone); margin-top: 4px; }
.login-error { background: #fdf0ef; border: 1px solid #f5c0bc; color: var(--red); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 20px; }
.login-2fa-msg { text-align: center; margin-bottom: 24px; }
.login-2fa-icon { font-size: 36px; margin-bottom: 12px; }
.login-2fa-msg p { font-size: 13px; color: var(--stone); line-height: 1.6; }
.login-back { text-align: center; font-size: 12px; margin-top: 16px; }

/* ── PAGE: ADMIN ───────────────────────────────────────── */
.page-admin { min-height: 100vh; background: #f0ece6; }
.admin-topbar { background: var(--ink); padding: 0 var(--side); display: flex; align-items: center; justify-content: space-between; height: 52px; position: sticky; top: 0; z-index: 90; }
.admin-logo { font-family: 'Cormorant Garamond', serif; font-size: 17px; color: var(--sand); }
.admin-logo span { color: var(--gold); font-style: italic; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--peat); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--sand); font-family: 'DM Mono', monospace; flex-shrink: 0; }
.admin-username { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--stone); }
.admin-logout { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--stone); padding: 6px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); }
.admin-logout:hover { text-decoration: none; color: var(--sand); }

.admin-tabs { background: var(--bark); display: flex; padding: 0 var(--side); border-bottom: 1px solid rgba(255,255,255,.05); overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex-shrink: 0; padding: 12px 16px; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--stone); border: none; border-bottom: 2px solid transparent; background: none; cursor: pointer; transition: all .2s; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-tab-action { color: var(--gold); margin-left: auto; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-body { padding: 20px var(--side); max-width: 860px; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e8e2da; border-radius: var(--radius); padding: 14px 16px; }
.stat-num { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 300; color: var(--ink); line-height: 1; }
.stat-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--stone); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--gold); margin-top: 3px; }

/* Toolbar */
.admin-toolbar { margin-bottom: 16px; }
.toolbar-search { margin-bottom: 10px; }
.search-input { width: 100%; padding: 9px 14px; background: #fff; border: 1px solid #e0d8cc; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--ink); }
.search-input:focus { outline: none; border-color: var(--gold); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { padding: 7px 12px; border: 1px solid #ddd; border-radius: var(--radius); font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--stone); background: #fff; cursor: pointer; }
.filter-chip.active, .filter-chip:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); text-decoration: none; }

/* Guest cards */
.guest-card { background: #fff; border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; border: 1px solid #e8e2da; transition: box-shadow .2s; }
.guest-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.guest-card-header { padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.guest-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.status-new { background: var(--rust); }
.status-sent { background: var(--gold); }
.status-progress { background: #5a8fa0; }
.status-complete { background: var(--moss); }
.guest-info { flex: 1; min-width: 0; }
.guest-name-placeholder { font-family: 'Cormorant Garamond', serif; font-size: 16px; color: var(--ink); }
.guest-meta { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--stone); letter-spacing: 1px; margin-top: 3px; }
.guest-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { padding: 2px 7px; border-radius: 1px; font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; flex-shrink: 0; }
.tag-lodge { background: #e8f0e6; color: var(--moss); }
.tag-activity { background: #f0e8e4; color: var(--rust); }
.tag-status.status-new { background: #f5e8e4; color: var(--rust); }
.tag-status.status-sent { background: #f5f0e4; color: #8a6a20; }
.tag-status.status-progress { background: #e4eef0; color: #2a6a7a; }
.tag-status.status-complete { background: #e6f0e8; color: var(--moss); }

.guest-card-body { padding: 0 16px 16px; border-top: 1px solid #f0ece6; }
.detail-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; padding-top: 14px; }
.detail-item label { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--stone); display: block; margin-bottom: 2px; }
.detail-item span { font-size: 13px; color: var(--ink); word-break: break-word; }
.loading-detail { font-size: 12px; color: var(--stone); padding: 14px 0; }

.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0ece6; }
.action-btn { padding: 7px 12px; border-radius: var(--radius); cursor: pointer; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; transition: all .2s; border: 1px solid; text-decoration: none; display: inline-block; }
.action-link { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.action-link:hover { background: var(--gold-h); text-decoration: none; }
.action-view { background: transparent; color: var(--peat); border-color: #ddd; }
.action-view:hover { background: var(--fog); text-decoration: none; }
.action-doc { background: transparent; color: var(--moss); border-color: #c0d4bc; }
.action-pdf { background: transparent; color: var(--rust); border-color: #d4b0a0; }
.action-pdf:hover { background: #fdf0ec; text-decoration: none; }

/* Audit */
.audit-header { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--stone); margin-bottom: 12px; }
.audit-table { background: #fff; border: 1px solid #e8e2da; border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
.audit-row { display: grid; grid-template-columns: 90px 1fr 70px 80px 70px; padding: 10px 16px; border-bottom: 1px solid #f5f1eb; font-size: 11px; align-items: start; min-width: 480px; }
.audit-row:last-child { border-bottom: none; }
.audit-row-header { background: var(--ink); color: var(--stone); font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase; }
.audit-user { font-weight: 500; color: var(--peat); word-break: break-word; }
.audit-action { color: var(--ink); }
.audit-guest { color: var(--stone); }
.audit-detail { display: block; font-size: 10px; color: var(--stone); margin-top: 2px; }
.audit-ip { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--stone); }
.audit-time { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--stone); }
.badge { display: inline-block; padding: 2px 6px; border-radius: 1px; font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1px; background: #f0ece6; color: var(--peat); white-space: nowrap; }
.empty-state { padding: 40px; text-align: center; color: var(--stone); font-size: 14px; }

/* ── DESKTOP BREAKPOINTS ───────────────────────────────── */
@media (min-width: 600px) {
  :root { --side: 32px; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .admin-body { padding: 24px var(--side); }
  .hero { padding: 48px var(--side) 40px; }
  .hero-title { font-size: 40px; }
  .guest-card-header { align-items: center; }
  .guest-tags { flex-wrap: nowrap; }
}

@media (min-width: 860px) {
  .admin-body { max-width: 900px; margin: 0 auto; padding: 28px 40px; }
}
