/* ============================================================================
   Guest app — mobile first. Optimised for one-handed use in a hotel room.
   ========================================================================== */

body.guest { background: var(--canvas); }

.guest-shell {
  max-width: 620px;
  margin-inline: auto;
  min-height: 100vh;
  background: var(--surface);
  box-shadow: 0 0 60px rgba(15, 32, 30, 0.07);
  padding-bottom: var(--space-12);
}

/* ------------------------------------------------------------- header --- */
.guest-header {
  position: relative;
  padding: var(--space-4) var(--space-5) var(--space-8);
  color: #fff;
  background:
    radial-gradient(120% 90% at 88% -10%, color-mix(in srgb, var(--accent) 40%, transparent) 0%, transparent 55%),
    linear-gradient(150deg, var(--brand-strong, #0a544f) 0%, var(--brand) 60%, color-mix(in srgb, var(--brand) 70%, #0b3b38) 100%);
  border-end-start-radius: var(--radius-xl);
  border-end-end-radius: var(--radius-xl);
}
.guest-topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.hotel-id { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.hotel-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: var(--font-display); font-size: var(--text-md); font-weight: 600;
}
.hotel-id strong { display: block; font-size: var(--text-sm); font-weight: 650; }
.hotel-id span { font-size: var(--text-xs); opacity: 0.72; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.chip-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff; font-size: var(--text-xs); font-weight: 600; cursor: pointer;
}
.chip-button:hover { background: rgba(255, 255, 255, 0.24); }
.lang-select {
  appearance: none; cursor: pointer;
  min-height: 34px; padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff; font-size: var(--text-xs); font-weight: 700;
}
.lang-select option { color: var(--ink); background: var(--surface); }

.guest-hero { margin-top: var(--space-6); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.85;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7ee0c8; }
.eyebrow[data-state="ended"]::before { background: #f5c46b; }
.guest-hero h1 {
  margin: var(--space-2) 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}
.guest-hero p { font-size: var(--text-sm); opacity: 0.84; max-width: 42ch; }

.stay-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
  margin-top: var(--space-5);
}
.fact {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.fact span { display: block; font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.72; }
.fact strong { font-size: var(--text-sm); font-weight: 650; }

/* -------------------------------------------------------------- body ---- */
.guest-main { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-6); }
.guest-main section { display: flex; flex-direction: column; gap: var(--space-3); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.section-head h2 { font-size: var(--text-md); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: calc(var(--space-6) * -1); }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: var(--text-xs); font-weight: 600; text-align: center; cursor: pointer;
}
.quick-action:hover { text-decoration: none; border-color: var(--brand); }
.quick-action svg { color: var(--brand); }

/* ----------------------------------------------------------- services --- */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 520px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }

.service-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  padding: var(--space-4);
  min-height: 118px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.service-tile:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-sm); }
.service-tile:active { transform: translateY(0); }
.service-tile .tile-icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--brand-soft); color: var(--brand);
}
.service-tile strong { font-size: var(--text-sm); font-weight: 620; line-height: 1.3; }
.service-tile .tile-meta { font-size: var(--text-2xs); color: var(--ink-muted); display: flex; gap: 6px; align-items: center; }

/* ----------------------------------------------------------- requests --- */
.request-card {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.request-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.request-title { display: flex; align-items: center; gap: var(--space-2); font-weight: 620; }
.request-title .tile-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.request-note { font-size: var(--text-sm); color: var(--ink-secondary); }

.progress { display: flex; align-items: center; gap: 4px; }
.progress-step { flex: 1; height: 4px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; }
.progress-step[data-done="1"] { background: var(--brand); }
.progress-step[data-active="1"] {
  background: linear-gradient(90deg, var(--brand) 50%, var(--surface-sunken) 50%);
  background-size: 200% 100%;
  animation: slide 1.6s linear infinite;
}
@keyframes slide { from { background-position: 100% 0; } to { background-position: 0 0; } }
.progress-labels { display: flex; justify-content: space-between; font-size: var(--text-2xs); color: var(--ink-muted); }

.feedback-note {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); font-size: var(--text-sm); color: var(--ink-secondary);
}

/* --------------------------------------------------------------- sheet -- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--overlay); backdrop-filter: blur(2px);
  animation: fade var(--transition);
}
@media (min-width: 620px) { .sheet-backdrop { align-items: center; } }
.sheet {
  width: min(100%, 560px);
  max-height: 92vh; overflow: auto;
  padding: var(--space-5);
  background: var(--surface);
  border-start-start-radius: var(--radius-xl);
  border-start-end-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: rise 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
@media (min-width: 620px) { .sheet { border-radius: var(--radius-lg); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; border-radius: var(--radius-full); background: var(--border-strong); margin: 0 auto var(--space-4); }
.sheet h2 { font-size: var(--text-lg); }

.priority-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.priority-chip {
  padding: 7px 13px; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: var(--text-xs); font-weight: 600; cursor: pointer; color: var(--ink-secondary);
}
.priority-chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.star-picker { display: flex; justify-content: center; gap: var(--space-2); direction: ltr; }
.star-picker button {
  border: 0; background: transparent; cursor: pointer; padding: 4px;
  color: var(--border-strong); transition: transform var(--transition), color var(--transition);
}
.star-picker button svg { width: 34px; height: 34px; }
.star-picker button[data-on="1"] { color: var(--accent); }
.star-picker button:hover { transform: scale(1.12); }

/* ---------------------------------------------------------- guest entry -- */
.guest-entry { padding: var(--space-5); }
.entry-card {
  display: flex; flex-direction: column; gap: var(--space-4);
  max-width: 520px; margin: 0 auto;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.entry-option-head { display: flex; align-items: center; gap: var(--space-3); }
.entry-option-head.compact { margin-bottom: calc(var(--space-2) * -1); }
.entry-option-head h2 { margin-bottom: 2px; font-size: var(--text-md); }
.entry-icon {
  display: grid; place-items: center; flex: none;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--brand-soft); color: var(--brand);
}
.entry-divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--ink-muted); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.entry-divider::before, .entry-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.entry-divider span { white-space: nowrap; }
.entry-message[hidden] { display: none; }
.qr-scanner { position: relative; overflow: hidden; border-radius: var(--radius-md); background: #07110f; }
.qr-scanner[hidden] { display: none; }
.qr-scanner video { display: block; width: 100%; max-height: 360px; object-fit: cover; aspect-ratio: 4 / 3; }
.qr-scanner .btn { border-radius: 0; }
.qr-target {
  position: absolute; top: 50%; left: 50%; width: 52%; aspect-ratio: 1;
  transform: translate(-50%, -58%);
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}
@media (max-width: 420px) {
  .guest-entry { padding: var(--space-4); }
  .entry-card { padding: var(--space-4); }
}

/* -------------------------------------------------------------- misc ---- */
.guest-footer {
  padding: var(--space-6) var(--space-5) var(--space-8);
  text-align: center; color: var(--ink-muted); font-size: var(--text-xs);
}
.guest-error {
  margin: var(--space-8) auto; max-width: 420px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
}
.guest-error .tile-icon {
  display: grid; place-items: center; width: 54px; height: 54px;
  border-radius: 16px; background: var(--warn-soft); color: var(--warn);
}

[dir="rtl"] body { font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, var(--font-sans); }
[dir="rtl"] .guest-hero h1 { font-family: inherit; font-weight: 650; }
