/* ==========================================================================
   RIVERSIDE HOMESTAY & FARM — "MỘT ĐÊM CHO EM"
   Design System: High-Craft Light Mode & Frosted Glass Chrome (Anti-AI-Slop)
   Strict 5-Step Type Scale: 14px / 16px / 20px / 36px / 72px
   ========================================================================== */

:root {
  /* Pure Daylight Ground & Warm Stone Tonal Surfaces */
  --bg-page: #ffffff;
  --bg-tonal: #f6f4f2;
  --bg-tonal-hover: #ece8e4;
  --bg-glass-bar: rgba(255, 255, 255, 0.88);

  /* High-Contrast Ink Hierarchy (Matched to RIVERSIDE Wordmark Jet Black) */
  --text-main: #111111;
  --text-secondary: #4a4542;
  --text-muted: #756e69;

  /* Official Brand Accent: Bahnar Rong Roof Vermilion Red (#C92B00) */
  --primary: #c92b00;
  --primary-hover: #a32200;
  --primary-tint: #fceee9;

  /* Earthy Wood Accent */
  --accent-wood: #6e3b26;

  /* Semantic Status Palette */
  --success: #166534;
  --success-bg: #dcfce7;
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #1e40af;
  --info-bg: #dbeafe;

  /* Hairlines & Aliases */
  --line-subtle: #e4e0dc;
  --line-strong: #c9c3bd;
  --border-color: rgba(17, 17, 17, 0.12);
  --bg-subtle: #f6f4f2;
  --olive: #4a4542;

  /* Typography — Unified Be Vietnam Pro Art-House System */
  --font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radii & Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-page);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================================================
   STRICT TYPOGRAPHY & NUMERALS (Be Vietnam Pro)
   ========================================================================== */

h1, h2, .serif-heading {
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h3, h4 {
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-main);
  font-size: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

.tabular-nums,
.price,
.amount,
.stat-value,
.counter-val,
.ticket-price,
.summary-total,
input[type="tel"],
input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-md);
}

.container-wide {
  max-width: 1120px;
}

.card {
  background: var(--bg-tonal);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

/* ==========================================================================
   FLAT TACTILE BUTTONS (No Decorative Glows or Drop Shadows)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  gap: 8px;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background-color: var(--bg-tonal);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-tonal-hover);
  color: var(--text-main);
}

.btn-outline {
  background-color: var(--bg-tonal);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-tonal-hover);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.875rem;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 0.875rem;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, background-color 0.18s ease;
  appearance: none;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-control:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.form-control.is-invalid {
  border-color: var(--danger);
  background-color: #fffafa;
}

textarea.form-control {
  min-height: 88px;
  resize: vertical;
}

.field-error {
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 6px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ==========================================================================
   BADGES & ALERTS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.3;
  gap: 6px;
}

.badge-paid, .badge-valid, .badge-checked-in {
  background-color: var(--success-bg);
  color: var(--success);
}

.badge-unpaid, .badge-warning, .badge-reported {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.badge-cancelled, .badge-danger, .badge-expired {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.badge-info, .badge-pending {
  background-color: var(--info-bg);
  color: var(--info);
}

.badge-not-checked-in, .badge-checkin {
  background-color: var(--bg-tonal);
  color: var(--text-secondary);
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

.alert-error {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.alert-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success);
}

.alert-info {
  background-color: var(--info-bg);
  color: var(--info);
}

/* ==========================================================================
   UTILITIES & MOTION
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.hidden {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.75s linear infinite;
}

.spinner-dark {
  border-color: rgba(201, 43, 0, 0.2);
  border-top-color: var(--primary);
}

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

/* ==========================================================================
   HIGH-CRAFT CUSTOM DROPDOWN SYSTEM (ANTI-BROWSER-DEFAULT)
   Strictly aligned with Riverside "Một Đêm Cho Em" Design Language
   ========================================================================== */

/* Ẩn select gốc một cách an toàn cho trợ năng & forms */
.custom-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Container chính của custom dropdown */
.custom-select-container {
  position: relative;
  display: inline-block;
  width: 100%;
  font-family: var(--font-family);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}

/* Trigger Button */
.custom-select-trigger {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.94rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  box-sizing: border-box;
}

.custom-select-trigger:hover {
  border-color: var(--text-secondary);
  background-color: var(--bg-tonal);
}

.custom-select-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 43, 0, 0.16);
}

.custom-select-container.is-open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 43, 0, 0.16);
  background-color: #ffffff;
}

.custom-select-trigger:active:not(:disabled) {
  transform: scale(0.995);
}

/* Trigger Label */
.custom-select-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
  flex: 1;
  color: var(--text-main);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

/* Arrow / Chevron */
.custom-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.18s ease;
}

.custom-select-container.is-open .custom-select-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: var(--primary);
}

/* Dropdown Popover Menu */
.custom-select-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 100%;
  min-width: 100%;
  max-height: 280px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 38px -4px rgba(17, 17, 17, 0.14), 0 4px 12px -2px rgba(17, 17, 17, 0.06);
  z-index: 1060;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
  padding: 6px;
  box-sizing: border-box;
}

/* Dropup Placement (khi gần mép dưới màn hình) */
.custom-select-container.is-dropup .custom-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(8px) scale(0.98);
}

.custom-select-container.is-open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Custom Slim Scrollbar for Menu */
.custom-select-menu::-webkit-scrollbar {
  width: 5px;
}
.custom-select-menu::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-menu::-webkit-scrollbar-thumb {
  background: rgba(17, 17, 17, 0.2);
  border-radius: 999px;
}
.custom-select-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 17, 17, 0.35);
}

/* Options */
.custom-select-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
  outline: none;
  gap: 10px;
  box-sizing: border-box;
}

.custom-select-option:hover,
.custom-select-option.is-highlighted {
  background-color: var(--bg-tonal);
  color: var(--text-main);
}

.custom-select-option.is-selected {
  background-color: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}

.custom-select-option-text {
  flex: 1;
  min-width: 0;
}

.custom-select-check {
  display: none;
  color: var(--primary);
  flex-shrink: 0;
}

.custom-select-option.is-selected .custom-select-check {
  display: inline-flex;
  align-items: center;
}

/* Disabled option / container */
.custom-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.custom-select-container.is-disabled .custom-select-trigger {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variants */
/* 1. Pill Variant (Trang Chủ & Register: .art-dropdown) */
.custom-select-container.is-pill .custom-select-trigger {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 44px 0 20px;
  border-color: rgba(17, 17, 17, 0.28);
  background-color: #ffffff;
}
.custom-select-container.is-pill.is-open .custom-select-trigger {
  border-color: var(--primary);
}
.custom-select-container.is-pill .custom-select-menu {
  border-radius: 16px;
  padding: 8px;
}
.custom-select-container.is-pill .custom-select-option {
  border-radius: 10px;
  padding: 11px 16px;
}

/* 2. Compact Pill Variant (.art-compact-select in Register) */
.custom-select-container.is-compact {
  width: auto;
  display: inline-block;
}
.custom-select-container.is-compact .custom-select-trigger {
  min-height: 36px;
  height: 36px;
  padding: 0 30px 0 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  border-color: rgba(201, 43, 0, 0.35);
  border-radius: 999px;
  background-color: #ffffff;
}
.custom-select-container.is-compact .custom-select-arrow {
  right: 10px;
  width: 14px;
  height: 14px;
  color: var(--primary);
}
.custom-select-container.is-compact .custom-select-menu {
  border-radius: 14px;
  min-width: 240px;
  right: 0;
  left: auto;
}

/* 3. Small Staff Form Control (min-height: 42px) */
.custom-select-container.is-sm .custom-select-trigger {
  min-height: 42px;
  height: 42px;
  padding: 0 34px 0 12px;
  font-size: 0.85rem;
}
.custom-select-container.is-sm .custom-select-arrow {
  right: 10px;
}
.custom-select-container.is-sm .custom-select-menu {
  min-width: 100%;
}

/* ==========================================================================
   MODAL DIALOGS (Tập trung & Nhất quán)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  padding: 28px 24px;
  border-radius: var(--radius-md);
  border-top: 3px solid var(--primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  position: relative;
  max-height: 90vh;
  overflow-y: visible;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background-color 0.15s;
}

.modal-close:hover {
  color: var(--text-main);
  background-color: var(--bg-tonal);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   TOAST NOTIFICATIONS (Fixed Overlay — Zero Layout Shift)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.toast {
  background: var(--text-main);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-family: var(--font-family);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.18);
  pointer-events: auto;
}

.toast-success {
  border-left-color: #22c55e;
}

.toast-error {
  border-left-color: #ef4444;
}

.toast-warning {
  border-left-color: #f59e0b;
}


