/*
 * HotelOS design tokens (spec §16.2).
 * Components must consume these variables rather than hard-coded values.
 * Use logical properties (margin-inline, padding-block, inset-inline-start)
 * so layouts mirror correctly for RTL (fa-IR) and LTR (en).
 *
 * Look and feel follows the hotel's GRMS Monitor (bronze brand, navy side navigation, soft rounded cards,
 * one accent per kind of information). Every text colour here keeps at least 4.5:1 against the surface it is
 * used on, and every accent used for an icon tile keeps 3:1 against white (WCAG 2.2 AA).
 */
:root {
  /* Typography */
  /* Self-hosted Vazirmatn (fonts.css); Tahoma is the best-shaped Persian fallback on older Windows. */
  --hos-font-sans: 'Vazirmatn Variable', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, Roboto, sans-serif;
  --hos-font-size-sm: 0.875rem;
  --hos-font-size-md: 1rem;
  --hos-font-size-lg: 1.25rem;
  --hos-font-size-xl: 1.75rem;

  /* Spacing (4px scale) */
  --hos-space-1: 0.25rem;
  --hos-space-2: 0.5rem;
  --hos-space-3: 0.75rem;
  --hos-space-4: 1rem;
  --hos-space-6: 1.5rem;
  --hos-space-8: 2rem;

  /* Radius */
  --hos-radius-sm: 8px;
  --hos-radius-md: 10px;
  --hos-radius-lg: 16px;

  /* Neutral surfaces */
  --hos-color-bg: #f4f5fb;
  --hos-color-surface: #ffffff;
  --hos-color-surface-2: #f7f8fc;
  --hos-color-border: #e1e4ee;
  /* Boundaries of inputs and buttons: at least 3:1 against bg and surface (WCAG 1.4.11). */
  --hos-color-border-control: #7a8094;
  --hos-color-text: #0f172a;
  --hos-color-text-muted: #475569;

  /* Brand: bronze. White text on --hos-color-primary is 5.6:1; the gradient end is darker still. */
  --hos-color-primary: #8a5a2b;
  --hos-color-primary-2: #6f4520;
  --hos-color-on-primary: #ffffff;
  /* Icon colour on a solid accent tile: white on the light-theme accents, near-black on the lighter dark-theme ones. */
  --hos-on-accent: #ffffff;
  --hos-color-primary-soft: #f6ede2;
  --hos-gradient-primary: linear-gradient(135deg, #96622f, #6f4520);

  /* Navigation: the navy panel of the side menu. */
  --hos-nav-1: #0b2230;
  --hos-nav-2: #113a4f;
  --hos-nav-3: #1a5a6e;
  --hos-nav-text: #e3edf1;
  --hos-nav-muted: #b9cbd3;
  --hos-nav-accent: #f0c48f;

  /* Elevation */
  --hos-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --hos-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 14px 32px rgba(15, 23, 42, 0.1);

  /*
   * One accent per kind of information. Cards and icon tiles take them with --hos-card-accent; the tinted
   * backgrounds are mixed from the accent, so a new colour needs no new rule.
   */
  --hos-accent-blue: #2a6fc4;
  --hos-accent-teal: #0e8062;
  --hos-accent-amber: #94590a;
  --hos-accent-rose: #c0457a;
  --hos-accent-violet: #5b4bc4;
  --hos-accent-orange: #b84815;
  --hos-accent-red: #c43a3a;
  --hos-accent-slate: #51607a;

  /*
   * Action/command status (spec §16.2: requested, pending, confirmed, failed;
   * §14.3: unknown outcomes are shown as unknown, never as success).
   */
  --hos-status-requested: #3e5a8a;
  --hos-status-pending: #8a5a00;
  --hos-status-confirmed: #1e6b3a;
  --hos-status-failed: #a32020;
  --hos-status-unknown: #475569;
  --hos-status-stale: #8a5a00;
}

/* Theme: follows the OS unless the user chose light or dark in My account (data-theme on <html>). */
:root[data-theme='light'] {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --hos-color-bg: #0b0d14;
  --hos-color-surface: #151823;
  --hos-color-surface-2: #1b1f2c;
  --hos-color-border: #2a2f3f;
  --hos-color-border-control: #747b90;
  --hos-color-text: #f1f5f9;
  --hos-color-text-muted: #a9b0c0;
  --hos-color-primary: #e0b27a;
  --hos-color-primary-2: #c08a4e;
  --hos-color-on-primary: #1a1206;
  --hos-on-accent: #0b0d14;
  --hos-color-primary-soft: #3a2c1e;
  --hos-gradient-primary: linear-gradient(135deg, #e6bd89, #c08a4e);
  --hos-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --hos-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.35);
  --hos-accent-blue: #6aa7f0;
  --hos-accent-teal: #3ccfa0;
  --hos-accent-amber: #e8b04a;
  --hos-accent-rose: #ef88b0;
  --hos-accent-violet: #a399f0;
  --hos-accent-orange: #f08a5c;
  --hos-accent-red: #f08080;
  --hos-accent-slate: #a2b0cc;
  --hos-status-requested: #9fb3d1;
  --hos-status-pending: #e0b25a;
  --hos-status-confirmed: #6fca8e;
  --hos-status-failed: #f08080;
  --hos-status-unknown: #a9b0c0;
  --hos-status-stale: #e0b25a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --hos-color-bg: #0b0d14;
    --hos-color-surface: #151823;
    --hos-color-surface-2: #1b1f2c;
    --hos-color-border: #2a2f3f;
    --hos-color-border-control: #747b90;
    --hos-color-text: #f1f5f9;
    --hos-color-text-muted: #a9b0c0;
    --hos-color-primary: #e0b27a;
    --hos-color-primary-2: #c08a4e;
    --hos-color-on-primary: #1a1206;
    --hos-on-accent: #0b0d14;
    --hos-color-primary-soft: #3a2c1e;
    --hos-gradient-primary: linear-gradient(135deg, #e6bd89, #c08a4e);
    --hos-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --hos-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.35);
    --hos-accent-blue: #6aa7f0;
    --hos-accent-teal: #3ccfa0;
    --hos-accent-amber: #e8b04a;
    --hos-accent-rose: #ef88b0;
    --hos-accent-violet: #a399f0;
    --hos-accent-orange: #f08a5c;
    --hos-accent-red: #f08080;
    --hos-accent-slate: #a2b0cc;
    --hos-status-requested: #9fb3d1;
    --hos-status-pending: #e0b25a;
    --hos-status-confirmed: #6fca8e;
    --hos-status-failed: #f08080;
    --hos-status-unknown: #a9b0c0;
    --hos-status-stale: #e0b25a;
  }
}
