/* ==========================================================================
   HELTHIO — Hospital App · Central Theme
   --------------------------------------------------------------------------
   The ONLY file that holds brand values: colours, fonts, sizes, spacing,
   radii and shadows. Every page imports this file. Change a value here and
   every screen picks it up. Never put hex codes, font names or pixel sizes
   in HTML or in layout.css — use these variables.

   Source: Helthio — Brand & Identity Guidelines (Colour Palette p.17,
   Colour usage rules p.19, Typography p.25–26, Background usage p.14).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONTS — single @font-face block
   Paths are relative to this file: hospital-app-html/styles/theme.css
   → ../assets/fonts/
   Same pairing as the GP app: Neue Montreal (display — page titles,
   greetings, app-bar titles) and Manrope (UI — everything else).
   -------------------------------------------------------------------------- */
/* Manrope (UI face named in the guidelines) — body, labels, cards, forms */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

@font-face {
  font-family: "Neue Montreal";
  src: url("../assets/fonts/NeueMontreal-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("../assets/fonts/NeueMontreal-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("../assets/fonts/NeueMontreal-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ------------------------------------------------------------------------
     2. BRAND COLOURS (guidelines p.17)
     Theme: Blue – Teal – Soft Surface – Navy – White.
     Green/teal is the app's primary colour. Rules (p.19): teal for
     transitions & actions, blue for system authority, light blue for soft
     UI backgrounds, navy for hierarchy and depth.
     ------------------------------------------------------------------------ */
  --brand-teal: #17A999;          /* Secondary System Teal  */
  --brand-blue: #3E55A5;          /* Primary System Blue    */
  --brand-navy: #202A37;          /* Deep System Navy       */
  --brand-soft-surface: #E1F2FC;  /* Background Soft Surface */
  --brand-white: #FFFFFF;         /* Pure White             */

  /* Semantic roles — pages use these, not the raw brand values above.
     Green gradient theme: teal → deep emerald, the same three-stop shape
     the GP app uses for its blue (primary → dark → deep). */
  --color-primary: var(--brand-teal);
  --color-primary-dark: #0F7F73;
  --color-primary-deep: #0A4E47;
  --color-primary-bright: #1FC2AE;
  --color-primary-soft: #E2F5F2;
  --color-primary-tint: rgba(23, 169, 153, 0.09);   /* active drawer row */
  --color-primary-tint-strong: rgba(23, 169, 153, 0.14);
  --color-primary-contrast: var(--brand-white);

  --color-secondary: var(--brand-blue);
  --color-secondary-soft: #E1F2FC;
  --color-secondary-contrast: var(--brand-white);

  --color-navy: var(--brand-navy);
  --color-surface-soft: var(--brand-soft-surface);
  --color-white: var(--brand-white);

  /* Neutrals — same values as the GP app */
  --color-bg: #F1F8FE;            /* screen background behind cards (patient app) */
  --color-surface: var(--brand-white);
  --color-border: #E8EFF6;
  --color-border-strong: #BFCEDD;
  --color-text: var(--brand-navy);
  --color-text-muted: #5C6675;
  --color-text-subtle: #8D97A5;
  --color-text-inverse: var(--brand-white);

  /* Priority / status (JSR: Emergency = red, Urgent = orange, Normal = green) */
  --color-emergency: #C1272D;
  --color-emergency-soft: #FBEAEA;
  --color-urgent: #E0842A;
  --color-urgent-soft: #FCF0E3;
  --color-normal: var(--brand-teal);
  --color-normal-dark: #0F7F73;   /* Normal / done status text */
  --color-normal-soft: #E3F5F2;
  --color-info: var(--brand-blue);
  --color-info-soft: #E8ECF7;
  --color-muted-soft: #EEF1F4;

  /* Status set shared with the patient app (live cards, quick actions) */
  --color-status-action: #B27400;       /* action required */
  --color-status-action-soft: #FDF3DC;
  --color-status-intl: #5C4B9E;         /* insurance / international */
  --color-status-intl-soft: #EEEAF8;
  --color-emergency-border: #F2C9C9;
  --color-emergency-text: #8E4044;
  --color-progress-on-primary: #34D399; /* progress fill on a coloured card */
  --color-status-dot-ring: rgba(52, 211, 153, 0.25);

  /* Area outside the phone frame (desktop preview) */
  --color-stage: #DCE7F1;
  --color-device-frame: var(--brand-navy);
  --color-overlay: rgba(32, 42, 55, 0.45);

  /* Text / fills placed on a primary-coloured (gradient) surface */
  --color-on-primary-muted: rgba(255, 255, 255, 0.75);
  --color-on-primary-faint: rgba(255, 255, 255, 0.55);
  --color-on-primary-fill: rgba(255, 255, 255, 0.12);
  --color-on-primary-fill-strong: rgba(255, 255, 255, 0.16);
  --color-on-primary-border: rgba(255, 255, 255, 0.16);

  /* Green gradients */
  --gradient-primary: linear-gradient(150deg, var(--color-primary) 0%, var(--color-primary-dark) 55%, var(--color-primary-deep) 100%);
  --gradient-drawer: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 60%, var(--color-primary-deep) 100%);
  --gradient-screen: linear-gradient(165deg, var(--color-primary-bright) 0%, var(--color-primary) 30%, var(--color-primary-dark) 72%, var(--color-primary-deep) 100%);
  /* Same three-stop button gradient as the patient app, in teal */
  --gradient-button: linear-gradient(to bottom right, color-mix(in srgb, var(--color-primary) 84%, #fff), var(--color-primary) 52%, color-mix(in srgb, var(--color-primary) 82%, #000));
  --gradient-button-hover: linear-gradient(to bottom right, var(--color-primary), var(--color-primary-dark) 52%, var(--color-primary-deep));
  --gradient-sheen: radial-gradient(120% 90% at 88% -12%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 58%);

  /* ------------------------------------------------------------------------
     3. TYPOGRAPHY (guidelines p.25–26) — same scale as the GP app
     Display face (Neue Montreal, weight 500) for page titles, greetings and
     app-bar titles. UI face (Manrope) for everything else: card titles
     (13px bold), body (13px), meta (10–11px), section labels (9px caps).
     ------------------------------------------------------------------------ */
  --font-primary: "Manrope", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-heading: var(--font-primary);
  --font-display: var(--font-primary);
  --font-body: var(--font-ui);

  --font-size-caps: 10px;         /* section labels, nav labels, tiny meta */
  --font-size-xxs: 11px;
  --font-size-xs: 11.5px;
  --font-size-sm: 12.5px;
  --font-size-body: 14px;
  --font-size-md: 15px;
  --font-size-lg: 17px;           /* app-bar title */
  --font-size-xl: 19px;
  --font-size-2xl: 22px;          /* greeting / result title */
  --font-size-3xl: 26px;          /* welcome title */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --font-weight-black: 700;       /* GP never goes above bold */
  --font-weight-display: 700;     /* Manrope headings, as in the patient app */

  --line-height-tight: 1.25;
  --line-height-snug: 1.35;
  --line-height-base: 1.5;
  --letter-spacing-caps: 0.1em;
  --letter-spacing-display: 0;

  /* ------------------------------------------------------------------------
     4. SPACING, RADII, SHADOWS, SIZES
     ------------------------------------------------------------------------ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;             /* cards (patient app) */
  --radius-xl: 20px;
  --radius-2xl: 26px;
  --radius-pill: 999px;

  --radius-hero: 22px;

  --shadow-sm: 0 1px 2px rgba(32, 42, 55, 0.04), 0 6px 16px rgba(32, 42, 55, 0.04);   /* patient card shadow */
  --shadow-md: 0 2px 4px rgba(32, 42, 55, 0.05), 0 14px 30px rgba(32, 42, 55, 0.09);
  --shadow-lg: 0 16px 40px rgba(32, 42, 55, 0.18);
  --shadow-bar: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-device: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-drawer: 0 0 40px rgba(32, 42, 55, 0.28);
  --shadow-primary: 0 10px 22px rgba(15, 127, 115, 0.28);
  --shadow-hero: 0 12px 28px -10px rgba(10, 78, 71, 0.55);
  --shadow-hero-inset: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.18);

  --border-width: 1px;
  --focus-ring: 0 0 0 3px rgba(23, 169, 153, 0.28);

  /* Mobile viewport — same frame as the GP app (430 × 880, 10px bezel) */
  --device-width: 430px;
  --device-height: 880px;
  --device-bezel: 10px;
  --radius-device: 48px;
  --statusbar-height: 40px;
  --appbar-height: 66px;
  --bottomnav-height: 70px;
  --home-indicator-height: 0px;  /* hidden, as in the GP app */

  --icon-size-sm: 14px;
  --icon-size: 18px;
  --icon-size-lg: 20px;
  --icon-size-xl: 40px;
  --icon-stroke: 2;              /* GP app: lucide icons at stroke 2 */
  --avatar-size: 44px;
  --tile-icon-size: 40px;
  --need-icon-size: 52px;        /* "What do you need?" shortcut icons */
  --touch-target: 44px;
  --header-btn-size: 37px;       /* dashboard header buttons */
  --appbar-btn-size: 37px;       /* inner-page header buttons */
  --emp-name-width: 84px;        /* hospital name in the employee top bar */
  --emp-main-card-height: 120px; /* OPD / IPD cards on the employee dashboards */
  --table-min-width: 460px;      /* report tables scroll sideways below this */
  --logo-width: 160px;           /* min digital logo width is 140px (p.10) */
  --logo-width-sm: 96px;
  --monogram-size: 28px;

  /* Component dimensions */
  --space-half: 2px;
  --border-width-strong: 2px;
  --accent-border-width: 4px;     /* priority stripe on referral cards */
  --control-height-sm: 34px;
  --tab-height: 36px;
  --slot-height: 40px;
  --otp-height: 52px;
  --textarea-min-height: 88px;
  --tile-min-height: 100px;
  --card-pad: 14px;              /* GP cards and tiles: p-3.5 */
  --checkbox-size: 18px;
  --switch-width: 46px;
  --switch-height: 26px;
  --switch-knob: 20px;
  --switch-inset: 3px;
  --badge-count-min: 22px;
  --dot-size: 8px;
  --dot-offset: 10px;
  --legend-dot: 10px;
  --day-dot: 5px;
  --timeline-marker: 22px;
  --timeline-icon: 12px;
  --agenda-time-width: 56px;
  --bar-height: 10px;
  --split-height: 14px;
  --chart-height: 140px;
  --file-icon-size: 36px;
  --result-icon-size: 88px;
  --notch-width: 128px;
  --notch-height: 24px;
  --home-bar-width: 112px;
  --home-bar-height: 4px;
  --sheet-grip-width: 40px;
  --progress-height: 6px;
  --avatar-size-lg: 48px;
  --search-height: 48px;
  --live-icon-size: 36px;
  --promo-icon-size: 44px;
  --hero-icon-size: 40px;
  --dot: 5px;
  --dot-active: 22px;
  --welcome-logo-width: 186px;
  --welcome-feature-icon: 40px;
  --header-logo-width: 84px;
  --drawer-width: 80%;
  --drawer-max-width: 330px;
  --drawer-avatar: 48px;
  --drawer-icon-box: 32px;
  --drawer-close: 28px;
  --monogram-watermark: 150px;
  --badge-count-sm: 16px;
  --badge-count-md: 18px;
  --status-dot: 6px;
  --drawer-icon: 16px;
  --drawer-watermark: 128px;
  --icon-size-xs: 13px;
  /* Note: the phone breakpoint (480px) lives in layout.css media queries,
     because CSS variables cannot be used inside @media conditions. */

  --transition-fast: 150ms ease;
  --transition-base: 240ms ease;

  /* ------------------------------------------------------------------------
     5. FORMS & STEP WIZARD (matches the patient app's onboarding)
     Layout and type sizes follow the patient app onboarding; colours stay
     on the hospital app green theme.
     ------------------------------------------------------------------------ */
  --font-ui: "Manrope", var(--font-primary);
  --color-form-accent: var(--color-primary);
  --color-form-accent-dark: var(--color-primary-dark);
  --color-form-accent-soft: var(--color-primary-soft);
  --color-step-done: #8FD8CE;     /* completed step segment (light teal) */
  --color-step-label: #0F6F65;
  --color-field-bg: var(--brand-white);
  --color-field-border: #E8EFF6;
  --color-field-placeholder: #8D97A5;
  --color-action-bar-bg: rgba(255, 255, 255, 0.96);

  --font-size-field-label: 13px;
  --font-size-field: 15px;
  --font-size-page-title: 24px;
  --font-size-form-sm: 12.5px;     /* .text-sm, subtitles, notices */
  --font-size-form-xs: 11.5px;     /* .text-xs, hints, row descriptions */
  --font-size-form-row: 14px;     /* option / toggle row titles */
  --font-size-button: 14px;
  --font-size-button-lg: 15px;
  --font-weight-semibold: 600;
  --letter-spacing-step: 0.09em;

  --field-height: 50px;
  --field-pad-y: 13px;
  --field-pad-x: 16px;
  --field-border-width: 1px;
  --radius-field: 16px;
  --radius-chip: 12px;
  --radius-btn-pill: 24px;
  --chip-height: 35px;
  --btn-height: 50px;
  --round-btn-size: 36px;
  --country-code-width: 100px;
  --onb-logo-width: 100px;
  --onb-logo-gap: 16px;
  --steps-bar-height: 4px;
  --steps-bar-gap: 6px;
}

/* --------------------------------------------------------------------------
   5. BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-stage);
  -webkit-font-smoothing: antialiased;
}

/* h1/h2 = display face (page and section titles), h3/h4 = UI face bold
   (card titles) — the split the GP app uses. */
h1, h2, h3, h4 {
  margin: 0;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  letter-spacing: var(--letter-spacing-display);
}
h3, h4 {
  font-family: var(--font-ui);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
}
h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-md); }
h4 { font-size: var(--font-size-body); }

p { margin: 0; }

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

small,
.caption {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.label-caps {
  font-size: var(--font-size-xxs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
