/* ============================================================================
 * RAATZI | CENTRAL DESIGN SYSTEM
 * ============================================================================
 * File            : base-v1.css
 * Deployment Path : /Assets/Modules/base.css
 * Project         : RAATZI Cloud Kitchen
 * Version         : 1.0.0
 * Status          : Initial Foundation
 * Created         : 2026-10-09
 * Last Updated    : 2026-10-09
 *
 * Developer       : Mayank Chawdhari AKA BOSS294
 * Brand           : RAATZI
 *
 * COPYRIGHT & BRAND NOTICE
 * Copyright (c) 2026 RAATZI / Mayank Chawdhari, subject to applicable
 * ownership and agreements. RAATZI brand references do not assert that a
 * trademark registration has been granted.
 *
 * PURPOSE
 * Central visual foundation for typography, tokens, reset, layout helpers,
 * accessible controls, 13 button variants, 5 icon representations, responsive
 * behavior, scrolling and reduced-motion preferences.
 *
 * FONT / ICON INTEGRATION
 * - Font family is set to Work Sans. Load the font from the shared document
 *   head or a local licensed font asset; no remote @import is forced here.
 * - Lucide icons are JavaScript-rendered SVGs, not a CSS font. Load the Lucide
 *   runtime once from the shared-scripts.js module (prefer a pinned version
 *   for production), call lucide.createIcons(), and this stylesheet will style
 *   the generated SVGs. Do not add a duplicate runtime to each page.
 *
 * CHANGELOG
 * 1.0.0 - Initial RAATZI global design foundation.
 * ============================================================================ */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  color-scheme: light;

  /* Brand balance: approximately 60% white / 30% black / 10% warm yellow. */
  --raatz-white: #FFFFFF;
  --raatz-black: #111111;
  --raatz-black-soft: #202020;
  --raatz-yellow: #F5BD20;
  --raatz-yellow-hover: #E9AA08;
  --raatz-yellow-soft: #FFF5D6;
  --raatz-yellow-tint: #FFFAEB;

  /* Neutral scale */
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-ink: #111111;
  --color-ink-soft: #292929;
  --color-text: #171717;
  --color-text-secondary: #565656;
  --color-text-muted: #707070;
  --color-text-disabled: #929292;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #FAFAFA;
  --color-surface-muted: #F4F4F4;
  --color-surface-strong: #EAEAEA;
  --color-border: #E5E5E5;
  --color-border-strong: #C9C9C9;
  --color-divider: #EAEAEA;

  /* Semantic colors: reserved for feedback and status, not decorative branding. */
  --color-success: #167647;
  --color-success-bg: #EAF7EF;
  --color-danger: #B42318;
  --color-danger-hover: #8F1D14;
  --color-danger-bg: #FEF0EE;
  --color-warning: #8A4B00;
  --color-warning-bg: #FFF3D9;
  --color-info: #155EEF;
  --color-info-bg: #EFF6FF;

  /* Typography */
  --font-family-base: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-family-heading: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-size-xs: clamp(0.72rem, 0.68rem + 0.12vw, 0.78rem);
  --font-size-sm: clamp(0.84rem, 0.80rem + 0.14vw, 0.92rem);
  --font-size-md: 1rem;
  --font-size-lg: clamp(1.08rem, 1.02rem + 0.22vw, 1.2rem);
  --font-size-xl: clamp(1.25rem, 1.12rem + 0.42vw, 1.55rem);
  --font-size-2xl: clamp(1.55rem, 1.28rem + 0.90vw, 2.15rem);
  --font-size-3xl: clamp(1.9rem, 1.48rem + 1.45vw, 2.85rem);
  --font-size-4xl: clamp(2.2rem, 1.62rem + 2.1vw, 3.65rem);
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.12;
  --line-height-heading: 1.22;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.75;
  --letter-spacing-tight: -0.035em;
  --letter-spacing-wide: 0.045em;

  /* Layout and spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --page-gutter: clamp(1rem, 4vw, 2.25rem);
  --container-xs: 32rem;
  --container-sm: 42rem;
  --container-md: 56rem;
  --container-lg: 72rem;
  --container-xl: 84rem;
  --container-wide: 96rem;

  /* Radius */
  --radius-xs: 0.25rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.125rem;
  --radius-2xl: 1.5rem;
  --radius-pill: 999px;

  /* Shadows: subtle by default; tactile elevation is reserved for variants. */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.07);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.10);
  --shadow-lg: 0 16px 44px rgb(0 0 0 / 0.14);
  --shadow-focus: 0 0 0 3px rgb(245 189 32 / 0.42);
  --shadow-press: 0 2px 0 rgb(0 0 0 / 0.18);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 140ms;
  --duration-normal: 220ms;
  --duration-slow: 360ms;
  --transition-ui: color var(--duration-normal) var(--ease-standard),
                   background-color var(--duration-normal) var(--ease-standard),
                   border-color var(--duration-normal) var(--ease-standard),
                   box-shadow var(--duration-normal) var(--ease-standard),
                   opacity var(--duration-normal) var(--ease-standard),
                   transform var(--duration-normal) var(--ease-emphasized);

  /* Controls */
  --control-height-sm: 2.375rem;
  --control-height: 2.75rem;
  --control-height-lg: 3.125rem;
  --control-radius: var(--radius-md);
  --control-border: var(--color-border-strong);
  --focus-ring: 0 0 0 3px rgb(245 189 32 / 0.45);

  /* Layer map */
  --z-base: 0;
  --z-sticky: 100;
  --z-dropdown: 300;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 1100;

  /* Scrollbar */
  --scrollbar-size: 10px;
  --scrollbar-track: #F4F4F4;
  --scrollbar-thumb: #B8B8B8;
  --scrollbar-thumb-hover: #777777;
  --scrollbar-thumb-active: var(--raatz-yellow-hover);
}

/* ==========================================================================
   2. RESET AND DOCUMENT DEFAULTS
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scrollbar-gutter: stable;
  background: var(--raatz-white);
  accent-color: var(--raatz-yellow-hover);
  /* Smooth scrolling for all scroll events — wheel, keyboard, touch, anchor links */
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--raatz-white);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  /* Disable text selection globally — prevents accidental selection on scroll */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  /* Prevent touch selection on Android */
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

:where(img, picture, video, canvas, audio, iframe, embed, object) {
  display: block;
  max-width: 100%;
}

:where(img, picture, video) {
  height: auto;
}

:where(button, input, textarea, select) {
  margin: 0;
  font: inherit;
}

:where(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:where(button, input, textarea, select) {
  color: inherit;
}

:where(button) {
  cursor: pointer;
}

:where(button:disabled, input:disabled, select:disabled, textarea:disabled) {
  cursor: not-allowed;
}

:where(input, textarea, select) {
  max-width: 100%;
}

:where(textarea) {
  resize: vertical;
}

:where(table) {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

:where(th, td) {
  text-align: left;
  vertical-align: top;
}

:where(ul, ol) {
  padding-inline-start: 1.35em;
}

:where(hr) {
  height: 0;
  border: 0;
  border-top: 1px solid var(--color-divider);
}

:where(pre, code, kbd, samp) {
  font-family: var(--font-family-mono);
}

:where(pre) {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

:where(a) {
  color: inherit;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
}

:where(a:not([class])) {
  text-decoration-color: currentColor;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus {
  outline: none;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--raatz-black);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

:where([hidden]) {
  display: none !important;
}

:where([id]) {
  scroll-margin-top: 5rem;
}

::selection {
  color: var(--raatz-black);
  background: rgb(245 189 32 / 0.42);
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.heading {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-tight);
  text-wrap: balance;
}

h1, .text-display-xl { font-size: var(--font-size-4xl); }
h2, .text-display-lg { font-size: var(--font-size-3xl); }
h3, .text-heading-xl { font-size: var(--font-size-2xl); }
h4, .text-heading-lg { font-size: var(--font-size-xl); }
h5, .text-heading-md { font-size: var(--font-size-lg); }
h6, .text-heading-sm { font-size: var(--font-size-md); }

p {
  margin: 0;
  color: inherit;
  text-wrap: pretty;
}

:where(p + p) {
  margin-block-start: var(--space-4);
}

small, .text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--raatz-black); }
.text-accent { color: #8A6200; }
.text-white { color: var(--raatz-white); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.text-uppercase { text-transform: uppercase; letter-spacing: var(--letter-spacing-wide); }
.font-normal { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ==========================================================================
   4. RESPONSIVE LAYOUT PRIMITIVES
   ========================================================================== */
.container,
.page-container {
  width: min(100% - (var(--page-gutter) * 2), var(--container-lg));
  margin-inline: auto;
}

.container-xs { max-width: var(--container-xs); }
.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }
.container-wide { max-width: var(--container-wide); }

.page-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
  min-width: 0;
}

.section-space {
  padding-block: clamp(2.5rem, 6vw, 6rem);
}

.stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-4));
}

.cluster {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

.cluster-between {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.grid {
  display: grid;
  min-width: 0;
  gap: var(--grid-gap, var(--space-4));
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 15rem)), 1fr));
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.max-w-full { max-width: 100%; }
.mx-auto { margin-inline: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ==========================================================================
   5. SHARED SURFACES / CARDS / DIVIDERS
   ========================================================================== */
.surface,
.card {
  min-width: 0;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.card {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-normal) var(--ease-standard),
              box-shadow var(--duration-normal) var(--ease-standard),
              transform var(--duration-normal) var(--ease-emphasized);
}

.card-interactive:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.surface-subtle { background: var(--color-surface-subtle); }
.surface-muted { background: var(--color-surface-muted); }
.surface-brand { background: var(--raatz-yellow-soft); }
.surface-dark { color: var(--raatz-white); background: var(--raatz-black); border-color: var(--raatz-black); }
.divider { width: 100%; height: 1px; background: var(--color-divider); border: 0; }

.badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 1.5rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}

.badge-brand { border-color: rgb(245 189 32 / 0.5); background: var(--raatz-yellow-soft); color: var(--raatz-black); }
.badge-success { border-color: #B8E4C8; background: var(--color-success-bg); color: var(--color-success); }
.badge-danger { border-color: #F4C7C3; background: var(--color-danger-bg); color: var(--color-danger); }
.badge-warning { border-color: #F1D59D; background: var(--color-warning-bg); color: var(--color-warning); }

/* ==========================================================================
   6. FORMS
   ========================================================================== */
.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label,
label {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.form-help,
.form-error {
  margin: 0;
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.form-help { color: var(--color-text-muted); }
.form-error { color: var(--color-danger); }

.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  padding: 0.7rem 0.875rem;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.025);
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard);
}

textarea.form-control,
textarea {
  min-height: 7rem;
  resize: vertical;
}

select {
  padding-right: 2.5rem;
}

.form-control:hover,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):hover,
textarea:hover,
select:hover {
  border-color: #969696;
}

.form-control:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
textarea:focus,
select:focus {
  border-color: var(--raatz-black);
  box-shadow: var(--focus-ring);
}

.form-control[aria-invalid="true"],
.form-control.is-invalid,
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-danger);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  accent-color: var(--raatz-black);
}

input[type="range"] { width: 100%; accent-color: var(--raatz-yellow-hover); }
input[type="file"] { max-width: 100%; font-size: var(--font-size-sm); }
input::placeholder,
textarea::placeholder { color: #858585; opacity: 1; }

/* ==========================================================================
   7. BUTTON SYSTEM — all 13 selector variants, accessible states included
   ========================================================================== */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: var(--control-height);
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  vertical-align: middle;
  box-shadow: 0 0 0 rgb(0 0 0 / 0);
  transform: translateY(0) scale(1);
  transition: var(--transition-ui), outline-offset var(--duration-fast) var(--ease-standard);
}

.btn > .lucide,
.btn > svg,
.btn [data-lucide] {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  stroke-width: 1.9;
  pointer-events: none;
}

.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--raatz-black); outline-offset: 3px; box-shadow: var(--focus-ring); }
.btn:active { transform: translateY(2px) scale(0.985); transition-duration: 70ms; }
.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"],
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
  transform: none;
  filter: saturate(0.65);
}

/* 1. Solid — primary black button with white label. */
.btn-solid {
  border-color: var(--raatz-black);
  background: var(--raatz-black);
  color: var(--raatz-white);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.12);
}
.btn-solid:hover { border-color: #303030; background: #303030; color: #FFFFFF; box-shadow: 0 6px 16px rgb(0 0 0 / 0.16); transform: translateY(-1px); }
.btn-solid:active { background: #080808; box-shadow: inset 0 2px 3px rgb(0 0 0 / 0.24); transform: translateY(1px) scale(0.985); }

/* 2. Outline — white surface, black text and border. */
.btn-outline {
  border-color: var(--raatz-black);
  background: var(--raatz-white);
  color: var(--raatz-black);
}
.btn-outline:hover { background: var(--raatz-black); color: var(--raatz-white); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn-outline:active { background: #333333; color: #FFFFFF; transform: translateY(1px) scale(0.985); }

/* 3. Ghost — minimal low-emphasis control. */
.btn-ghost { border-color: transparent; background: transparent; color: var(--raatz-black); }
.btn-ghost:hover { border-color: var(--color-border); background: var(--color-surface-muted); color: var(--raatz-black); }
.btn-ghost:active { background: #EAEAEA; }

/* 4. Gradient — warm brand gradient; text stays black for readable contrast. */
.btn-gradient {
  border-color: #E3A500;
  background: linear-gradient(135deg, #FFD65B 0%, var(--raatz-yellow) 58%, #EDA900 100%);
  color: var(--raatz-black);
  box-shadow: 0 3px 0 #C18A00, 0 5px 14px rgb(193 138 0 / 0.18);
}
.btn-gradient:hover { box-shadow: 0 5px 0 #C18A00, 0 9px 20px rgb(193 138 0 / 0.22); transform: translateY(-2px); }
.btn-gradient:active { box-shadow: 0 1px 0 #C18A00, inset 0 2px 3px rgb(0 0 0 / 0.12); transform: translateY(2px) scale(0.99); }

/* 5. Elevated / 3D — tactile hard-shadow button with deliberate compression. */
.btn-elevated {
  border-color: #080808;
  background: var(--raatz-black);
  color: #FFFFFF;
  box-shadow: 0 4px 0 #000000, 0 8px 16px rgb(0 0 0 / 0.16);
  transform: translateY(0);
}
.btn-elevated:hover { box-shadow: 0 6px 0 #000000, 0 12px 22px rgb(0 0 0 / 0.2); transform: translateY(-2px); }
.btn-elevated:active { box-shadow: 0 1px 0 #000000, 0 2px 5px rgb(0 0 0 / 0.14); transform: translateY(3px); }

/* 6. Pill — prominent rounded brand button. */
.btn-pill { border-color: var(--raatz-yellow); border-radius: var(--radius-pill); background: var(--raatz-yellow); color: var(--raatz-black); padding-inline: 1.4rem; }
.btn-pill:hover { border-color: var(--raatz-yellow-hover); background: var(--raatz-yellow-hover); box-shadow: 0 7px 16px rgb(193 138 0 / 0.18); transform: translateY(-2px); }
.btn-pill:active { box-shadow: inset 0 2px 3px rgb(0 0 0 / 0.13); transform: translateY(1px) scale(0.985); }

/* 7. Soft — low-contrast brand-tinted action. */
.btn-soft { border-color: #F0D990; background: var(--raatz-yellow-soft); color: var(--raatz-black); }
.btn-soft:hover { border-color: #E8C452; background: #FFEDB0; transform: translateY(-1px); }
.btn-soft:active { background: #F9E29A; }

/* 8. Danger — semantic/destructive action. */
.btn-danger { border-color: var(--color-danger); background: var(--color-danger); color: #FFFFFF; }
.btn-danger:hover { border-color: var(--color-danger-hover); background: var(--color-danger-hover); color: #FFFFFF; box-shadow: 0 6px 16px rgb(180 35 24 / 0.2); transform: translateY(-1px); }
.btn-danger:active { background: #74170F; transform: translateY(1px) scale(0.985); }

/* 9. Muted — subdued secondary action. */
.btn-muted { border-color: var(--color-border); background: #F0F0F0; color: #4B4B4B; }
.btn-muted:hover { border-color: #D0D0D0; background: #E5E5E5; color: var(--raatz-black); }
.btn-muted:active { background: #DADADA; }

/* 10. Outline pill — outlined rounded action. */
.btn-outline-pill { border-color: var(--raatz-black); border-radius: var(--radius-pill); background: #FFFFFF; color: var(--raatz-black); padding-inline: 1.35rem; }
.btn-outline-pill:hover { border-color: var(--raatz-yellow-hover); background: var(--raatz-yellow); color: var(--raatz-black); transform: translateY(-1px); }
.btn-outline-pill:active { transform: translateY(1px) scale(0.985); }

/* 11. Glass — restrained glass surface, with opaque fallback. */
.btn-glass { border-color: rgb(17 17 17 / 0.14); background: rgb(255 255 255 / 0.88); color: var(--raatz-black); box-shadow: var(--shadow-xs); }
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .btn-glass { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
.btn-glass:hover { border-color: #D3B145; background: #FFFCF2; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn-glass:active { background: #FFF4D1; }

/* 12. Success — semantic confirmation action. */
.btn-success { border-color: #167647; background: #167647; color: #FFFFFF; }
.btn-success:hover { border-color: #105E37; background: #105E37; color: #FFFFFF; box-shadow: 0 6px 16px rgb(22 118 71 / 0.2); transform: translateY(-1px); }
.btn-success:active { background: #0D4A2B; transform: translateY(1px) scale(0.985); }

/* 13. Warning — semantic caution action. */
.btn-warning { border-color: #A65B00; background: #A65B00; color: #FFFFFF; }
.btn-warning:hover { border-color: #854900; background: #854900; color: #FFFFFF; box-shadow: 0 6px 16px rgb(166 91 0 / 0.2); transform: translateY(-1px); }
.btn-warning:active { background: #6E3C00; transform: translateY(1px) scale(0.985); }

/* Sizes and layout helpers */
.btn-sm { min-height: var(--control-height-sm); padding: 0.5rem 0.8rem; font-size: var(--font-size-xs); }
.btn-lg { min-height: var(--control-height-lg); padding: 0.85rem 1.4rem; font-size: var(--font-size-md); }
.btn-block,
.btn-full { width: 100%; }
.btn-compact { padding-inline: 0.8rem; }
.btn-loading { cursor: progress; }
.btn-loading > * { visibility: hidden; }
.btn-loading::after {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: raatzi-spin 700ms linear infinite;
}

/* Icon-only buttons maintain a usable hit target. */
.btn-ico,
.btn-icon {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  aspect-ratio: 1;
}
.btn-ico.btn-sm,
.btn-icon.btn-sm { width: 2.375rem; min-width: 2.375rem; height: 2.375rem; min-height: 2.375rem; }
.btn-ico.btn-lg,
.btn-icon.btn-lg { width: 3.125rem; min-width: 3.125rem; height: 3.125rem; min-height: 3.125rem; }
.btn-ico-circle,
.btn-icon-circle { border-radius: 50%; }

/* ==========================================================================
   8. ICON SYSTEM — all 5 selector representations
   Use <i data-lucide="..."> placeholders and initialize Lucide once in JS.
   ========================================================================== */
.lucide,
svg.lucide {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.16em;
  pointer-events: none;
}

.icon,
.icon-frame,
.ic1, .ic2, .ic3, .ic4, .ic5 {
  position: relative;
  display: inline-flex;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  min-height: 3rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--raatz-black);
  vertical-align: middle;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform var(--duration-normal) var(--ease-emphasized),
              background-color var(--duration-normal) var(--ease-standard),
              color var(--duration-normal) var(--ease-standard),
              border-color var(--duration-normal) var(--ease-standard),
              box-shadow var(--duration-normal) var(--ease-standard);
}

.icon > .lucide, .icon > svg,
.icon-frame > .lucide, .icon-frame > svg,
.ic1 > .lucide, .ic1 > svg,
.ic2 > .lucide, .ic2 > svg,
.ic3 > .lucide, .ic3 > svg,
.ic4 > .lucide, .ic4 > svg,
.ic5 > .lucide, .ic5 > svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 1.9;
}

.icon:hover, .icon-frame:hover, .ic1:hover, .ic2:hover, .ic3:hover, .ic4:hover, .ic5:hover {
  transform: translateY(-2px);
}
.icon:active, .icon-frame:active, .ic1:active, .ic2:active, .ic3:active, .ic4:active, .ic5:active {
  transform: translateY(1px) scale(0.97);
  transition-duration: 70ms;
}

/* Type 1 — 3D circular: warm accent, radial highlight and layered depth. */
.ic1,
.icon-type-1 {
  border: 1px solid #D7A300;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgb(255 255 255 / 0.75) 0%, rgb(255 255 255 / 0.08) 35%, transparent 58%),
              linear-gradient(145deg, #FFD95C 0%, var(--raatz-yellow) 60%, #D99400 100%);
  color: var(--raatz-black);
  box-shadow: 0 5px 12px rgb(0 0 0 / 0.16), inset 0 1px 0 rgb(255 255 255 / 0.6), inset 0 -2px 4px rgb(0 0 0 / 0.12);
}
.ic1:hover, .icon-type-1:hover { box-shadow: 0 9px 18px rgb(0 0 0 / 0.19), inset 0 1px 0 rgb(255 255 255 / 0.6), inset 0 -2px 4px rgb(0 0 0 / 0.12); }
.ic1:active, .icon-type-1:active { box-shadow: 0 2px 4px rgb(0 0 0 / 0.16), inset 0 2px 4px rgb(0 0 0 / 0.13); }

/* Type 2 — bordered line, no fill. */
.ic2,
.icon-type-2 {
  border: 1.5px solid var(--raatz-black);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--raatz-black);
}
.ic2:hover, .icon-type-2:hover { border-color: var(--raatz-yellow-hover); background: var(--raatz-yellow); color: var(--raatz-black); }

/* Type 3 — dashed outline. */
.ic3,
.icon-type-3 {
  border: 2px dashed #777777;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--raatz-black);
}
.ic3:hover, .icon-type-3:hover { border-color: var(--raatz-black); background: var(--raatz-yellow-soft); }

/* Type 4 — quiet soft-fill tile. */
.ic4,
.icon-type-4 {
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: #F0F0F0;
  color: var(--raatz-black);
}
.ic4:hover, .icon-type-4:hover { border-color: #E4C65F; background: var(--raatz-yellow-soft); }

/* Type 5 — 3D square with controlled hard shadow. */
.ic5,
.icon-type-5 {
  border: 1px solid #C99500;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #FFD65B 0%, var(--raatz-yellow) 70%, #E6A400 100%);
  color: var(--raatz-black);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.22), 0 5px 12px rgb(0 0 0 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.45);
}
.ic5:hover, .icon-type-5:hover { box-shadow: 4px 5px 0 rgb(0 0 0 / 0.23), 0 8px 16px rgb(0 0 0 / 0.15), inset 0 1px 0 rgb(255 255 255 / 0.45); }
.ic5:active, .icon-type-5:active { box-shadow: 1px 1px 0 rgb(0 0 0 / 0.22), inset 0 2px 3px rgb(0 0 0 / 0.12); transform: translate(2px, 2px) scale(0.98); }

/* Additional icon utility sizes / color modes. */
.icon-xs { width: 1.5rem; min-width: 1.5rem; height: 1.5rem; min-height: 1.5rem; }
.icon-sm { width: 2rem; min-width: 2rem; height: 2rem; min-height: 2rem; }
.icon-lg { width: 3.5rem; min-width: 3.5rem; height: 3.5rem; min-height: 3.5rem; }
.icon-xl { width: 4rem; min-width: 4rem; height: 4rem; min-height: 4rem; }
.icon-plain { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.icon-dark { border-color: var(--raatz-black); background: var(--raatz-black); color: #FFFFFF; }
.icon-accent { border-color: var(--raatz-yellow); background: var(--raatz-yellow); color: var(--raatz-black); }

/* ==========================================================================
   9. ACCESSIBLE INTERACTION HELPERS
   ========================================================================== */
.clickable-card {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.clickable-card:focus-visible { outline: 2px solid var(--raatz-black); outline-offset: 4px; box-shadow: var(--focus-ring); }

.skip-link {
  position: fixed;
  z-index: var(--z-toast);
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(calc(-100% - 1rem));
  padding: 0.75rem 1rem;
  border: 2px solid var(--raatz-black);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--raatz-black);
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-md);
}
.skip-link:focus { transform: translateY(0); }

.sr-only,
.visually-hidden {
  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;
}

/* ==========================================================================
   10. SCROLLING AND CUSTOM SCROLLBARS
   Smooth scrolling is enabled only when the user has not requested less motion.
   ========================================================================== */

/* Smooth scrolling with reduced-motion support */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

body,
.scroll-area,
.panel-body,
.modal-body,
.dropdown-menu {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar — enhanced styling for better visual hierarchy */
::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  min-height: 2.5rem;
  border: 2px solid var(--scrollbar-track);
  border-radius: var(--radius-pill);
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  transition: background-color 180ms ease, box-shadow 140ms ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
  box-shadow: 0 0 0 2px rgba(245, 189, 32, 0.2);
}

::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  background-clip: padding-box;
  box-shadow: 0 0 0 2px rgba(245, 189, 32, 0.35);
}

::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

.scroll-area {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.scroll-area-x { overflow-x: auto; overflow-y: hidden; }
.scroll-area-y { overflow-x: hidden; overflow-y: auto; }
.scrollbar-thin { scrollbar-width: thin; }
.scrollbar-hidden { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hidden::-webkit-scrollbar { display: none; }

/* ==========================================================================
   11. STATUS / LOADING / MOTION
   ========================================================================== */
@keyframes raatzi-spin { to { transform: rotate(360deg); } }
@keyframes raatzi-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes raatzi-slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.animate-fade-in { animation: raatzi-fade-in var(--duration-normal) var(--ease-standard) both; }
.animate-slide-up { animation: raatzi-slide-up var(--duration-normal) var(--ease-emphasized) both; }

.spinner {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: raatzi-spin 700ms linear infinite;
  vertical-align: middle;
}

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

  .btn:hover,
  .card-interactive:hover,
  .icon:hover,
  .icon-frame:hover,
  .ic1:hover, .ic2:hover, .ic3:hover, .ic4:hover, .ic5:hover {
    transform: none;
  }
}

/* ==========================================================================
   12. RESPONSIVE SAFETY
   ========================================================================== */
@media (max-width: 64rem) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .container, .page-container { width: min(100% - (var(--page-gutter) * 2), var(--container-md)); }
}

@media (max-width: 48rem) {
  :root { --page-gutter: 1rem; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cluster-between { align-items: flex-start; }
  .section-space { padding-block: clamp(2rem, 8vw, 3.75rem); }
}

@media (max-width: 37.5rem) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .container, .page-container { width: calc(100% - 2rem); }
  .btn-mobile-block { width: 100%; }
  .cluster-mobile-stack { align-items: stretch; flex-direction: column; }
  .cluster-mobile-stack > * { max-width: 100%; }
  .card { border-radius: var(--radius-md); }
  .btn { max-width: 100%; }
}

/* Safe viewport and inset helpers for notched phones and edge-to-edge layouts. */
.safe-inset-top { padding-top: env(safe-area-inset-top, 0px); }
.safe-inset-right { padding-right: env(safe-area-inset-right, 0px); }
.safe-inset-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }
.safe-inset-left { padding-left: env(safe-area-inset-left, 0px); }
.safe-inset-x { padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px); }
.safe-inset-y { padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px); }

/* Prefer larger, stable targets on touch-first devices. */
@media (pointer: coarse) {
  .btn:not(.btn-sm):not(.btn-ico):not(.btn-icon) { min-height: 2.75rem; }
  .btn-ico, .btn-icon { min-width: 2.75rem; min-height: 2.75rem; }
}

/* Reduce hover movement on devices that do not have a precise hover pointer. */
@media (hover: none) {
  .btn:hover,
  .card-interactive:hover,
  .icon:hover,
  .icon-frame:hover,
  .ic1:hover, .ic2:hover, .ic3:hover, .ic4:hover, .ic5:hover {
    transform: none;
  }
}

/* High-contrast / forced-color accessibility. */
@media (prefers-contrast: more) {
  :root { --color-border: #777777; --color-border-strong: #444444; }
  .btn, .form-control, input, textarea, select { border-width: 2px; }
}

@media (forced-colors: active) {
  .btn, .form-control, input, textarea, select, .ic1, .ic2, .ic3, .ic4, .ic5 {
    forced-color-adjust: auto;
  }
  .btn:focus-visible, :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}

/* Print: remove interactive polish and preserve legible contrast. */
@media print {
  html, body { background: #FFFFFF !important; color: #000000 !important; }
  .btn, .card, .surface { box-shadow: none !important; }
  .btn { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .scrollbar-hidden { overflow: visible !important; }
}
