/* ═══════════════════════════════════════════════════
   Casa Regal — Online Check-In
   checkin.css  |  Main stylesheet
   ═══════════════════════════════════════════════════ */

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

/* ── Base ──────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f7f5f2;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #ebe8e3;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

.header-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
}

.header-name    { font-size: 16px; font-weight: 700; color: #1a1a1a; line-height: 1.2; }
.header-tagline { font-size: 11px; color: #a0793c; font-weight: 500; letter-spacing: .5px; }

/* ── Page wrapper ──────────────────────────────────── */
.page { max-width: 700px; margin: 36px auto 80px; padding: 0 20px; }

/* ── State visibility ──────────────────────────────── */
#state-loading,
#state-error,
#state-form,
#state-success,
#state-done  { display: none; }

#state-loading.active,
#state-error.active,
#state-form.active,
#state-success.active,
#state-done.active  { display: block; }

/* ── Loading ───────────────────────────────────────── */
.loading-wrap { text-align: center; padding: 80px 20px; color: #999; }
.loading-wrap p { font-size: 14px; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e8e3dc;
  border-top-color: #a0793c;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ─────────────────────────────────────────── */
.error-wrap {
  background: #fff;
  border: 1px solid #f0d0c8;
  border-left: 4px solid #e05555;
  border-radius: 10px;
  padding: 28px 24px;
  margin-top: 20px;
}

.error-wrap h2 { font-size: 18px; color: #c0392b; margin-bottom: 8px; }
.error-wrap p  { font-size: 14px; color: #666; line-height: 1.6; }
.err-code      { font-family: monospace; background: #f8f0ee; padding: 2px 7px; border-radius: 3px; }

/* ── Booking banner ────────────────────────────────── */
.booking-banner {
  background: #fff;
  border: 1px solid #ebe8e3;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.banner-field { flex: 1; min-width: 110px; }

/* In fallback (booking not found) mode, hide the detail fields */
.booking-banner--simple .banner-field--detail { display: none; }

/* Fallback note */
.fallback-note {
  display: none;
  align-items: flex-start;
  gap: 10px;
  background: #fffbf2;
  border: 1px solid #e8c98a;
  border-left: 4px solid #a0793c;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #5a4010;
  line-height: 1.6;
}

.fallback-note.visible { display: flex; }
.fallback-note-icon    { flex-shrink: 0; font-size: 16px; margin-top: 1px; }

.banner-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #aaa;
  font-weight: 600;
  margin-bottom: 4px;
}

.banner-value       { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.banner-value.code  { font-family: monospace; font-size: 17px; color: #a0793c; letter-spacing: 1px; }
.banner-value.small { font-size: 13px; }

.prop-code-badge {
  display: inline-block;
  margin-top: 4px;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  color: #a0793c;
  letter-spacing: 0.6px;
  background: #fdf6ec;
  border: 1px solid #e8c98a;
  padding: 1px 7px;
  border-radius: 4px;
}

.prop-code-badge:empty { display: none; }

.platform-badge {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: #f0ebe3;
  color: #a0793c;
}

/* ── Section heading ───────────────────────────────── */
.section-heading {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #a0793c;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ── Guest cards ───────────────────────────────────── */
.guests-wrapper { display: flex; flex-direction: column; gap: 18px; }

.guest-card {
  background: #fff;
  border: 1px solid #ebe8e3;
  border-radius: 12px;
  padding: 22px;
}

.guest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.guest-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 9px;
}

.guest-num {
  width: 22px;
  height: 22px;
  background: #a0793c;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 17px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s, background .15s;
}

.remove-btn:hover { color: #e05555; background: #fff0f0; }

/* ── Form fields ───────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #888;
  font-weight: 700;
}

.field label .req { color: #a0793c; margin-left: 2px; }

.field label .opt {
  color: #bbb;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
}

.field input,
.field select {
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  background: #fafaf8;
  border: 1.5px solid #e0dbd4;
  border-radius: 7px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus {
  border-color: #a0793c;
  box-shadow: 0 0 0 3px rgba(160,121,60,.12);
  background: #fff;
}

.field input::placeholder { color: #ccc; }
.field input.prefilled     { background: #fdf8f0; color: #7a5e2a; font-weight: 500; }

/* ── ID Upload ─────────────────────────────────────── */
.upload-area {
  border: 1.5px dashed #d8d2c8;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  background: #fafaf8;
  transition: border-color .15s, background .15s;
}

.upload-area:hover          { border-color: #a0793c; background: #fdf8f0; }

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 20px; margin-bottom: 4px; }
.upload-text { font-size: 12px; color: #aaa; }
.upload-text strong { color: #a0793c; }

.upload-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  background: #f0ebe3;
  border-radius: 5px;
  padding: 7px 10px;
  margin-top: 8px;
}

.clear-file {
  margin-left: auto;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.clear-file:hover { color: #e05555; }

/* ── Add guest button ──────────────────────────────── */
.add-guest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 13px;
  background: #fff;
  border: 1.5px dashed #a0793c;
  border-radius: 10px;
  color: #a0793c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.add-guest-btn:hover { background: #fdf8f0; }

hr.div { border: none; border-top: 1px solid #ebe8e3; margin: 24px 0; }

/* ── Submit ────────────────────────────────────────── */
.submit-wrap { text-align: center; margin-top: 28px; }

.submit-btn {
  background: #1a1a1a;
  color: #f0e8d8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  border-radius: 7px;
  padding: 15px 48px;
  cursor: pointer;
  transition: background .15s;
}

.submit-btn:hover    { background: #333; }
.submit-btn:disabled { background: #ccc; cursor: not-allowed; }

.submitting-msg { display: none; margin-top: 12px; font-size: 13px; color: #a0793c; }
.submitting-msg.show { display: block; }

.submit-note { margin-top: 10px; font-size: 12px; color: #bbb; }

/* ── Success ───────────────────────────────────────── */
.success-card {
  background: #fff;
  border: 1px solid #ebe8e3;
  border-radius: 16px;
  padding: 56px 32px;
  text-align: center;
  margin-top: 20px;
}

.success-icon { font-size: 52px; margin-bottom: 18px; }
.success-card h2 { font-size: 24px; font-weight: 400; margin-bottom: 10px; }
.success-card p  { font-size: 14px; color: #777; line-height: 1.7; }

.success-code {
  display: inline-block;
  margin-top: 20px;
  font-family: monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: #a0793c;
  background: #f7f5f2;
  border: 1px solid #e8e3dc;
  border-radius: 7px;
  padding: 10px 24px;
}

.success-arrival-note { margin-top: 18px; font-size: 12px; color: #bbb; }

/* ── Already done ──────────────────────────────────── */
.done-card {
  background: #fff;
  border: 1px solid #ebe8e3;
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  margin-top: 20px;
}

.done-icon { font-size: 48px; margin-bottom: 16px; }
.done-card h2 { font-size: 22px; font-weight: 600; color: #1a1a1a; margin-bottom: 10px; }

.done-sub {
  font-size: 14px;
  color: #777;
  line-height: 1.7;
  margin-bottom: 28px;
}

.done-sub strong { color: #1a1a1a; }

.contact-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
  border: none;
  cursor: pointer;
}

.contact-btn:hover           { opacity: .85; }
.contact-btn.whatsapp        { background: #25d366; color: #fff; }
.contact-btn.call            { background: #1a1a1a; color: #f0e8d8; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row .field:first-child { grid-column: 1 / -1; }
}
