/* ─────────────────────────────────────────────────────────────────────────
   restorno-ui v2 · ui.css — shared components. Requires tokens.css first:
     <link rel="stylesheet" href="https://id.restorno.com/ui/v2/tokens.css">
     <link rel="stylesheet" href="https://id.restorno.com/ui/v2/ui.css">

   Every component reads semantic tokens (--r-bg, --r-surface, --r-ink,
   --r-accent …), so the SAME markup renders warm-light on a Brand surface and
   dark on an .r-app surface. Nothing here hardcodes a colour.
   ───────────────────────────────────────────────────────────────────────── */

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

html, body {
  margin: 0;
  background: var(--r-bg);
  color: var(--r-ink);
  font-family: var(--r-sans);
  font-size: var(--r-text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── typography ────────────────────────────────────────────────────────── */
.r-h1, .r-h2, .r-h3 { font-family: var(--r-serif); font-weight: 700; line-height: 1.15; margin: 0; text-wrap: balance; color: var(--r-ink); }
.r-h1 { font-size: var(--r-h1); font-weight: 900; }
.r-h2 { font-size: var(--r-h2); }
.r-h3 { font-size: var(--r-h3); }
.r-lead { font-size: var(--r-text-lg); color: var(--r-ink-soft); }
.r-muted { color: var(--r-muted); }
.r-eyebrow {
  font-family: var(--r-mono); font-size: var(--r-text-xs);
  text-transform: uppercase; letter-spacing: .16em;
  color: var(--r-accent); font-weight: 600;
}
.r-wordmark {
  font-family: var(--r-serif); font-weight: 900; letter-spacing: .02em;
  color: var(--r-ink);
}
.r-wordmark .dot { color: var(--r-accent); }

/* ── brand mark — THE shared logo lockup for every app header ───────────────
   Usage:  <a class="r-brandmark" href="/">
             <img src="https://id.restorno.com/ui/v2/logo/favicon-32.png" alt="Restorno">
             <span class="r-wordmark">רסטורנו<span class="dot">.</span></span>
           </a>
   The small rounded icon is the detailed logo; the wordmark carries at any size.
   On the dark espresso .r-header the wordmark switches to gold automatically. */
.r-brandmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.r-brandmark img {
  width: 32px; height: 32px; border-radius: 9px; display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,.28); background: var(--r-surface);
}
.r-brandmark .r-wordmark { font-size: 1.2rem; }
.r-brandmark-lg img { width: 44px; height: 44px; border-radius: 12px; }
.r-brandmark-lg .r-wordmark { font-size: 1.5rem; }
.r-header .r-brandmark .r-wordmark {
  background: linear-gradient(120deg, #e8cf9a, #f7ecd0 35%, var(--r-gold) 60%, #f2e2b8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── buttons — ONE radius, one shape language ──────────────────────────── */
.r-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1px solid var(--r-line-strong);
  border-radius: var(--r-radius);
  background: var(--r-surface);
  color: var(--r-ink);
  font-family: inherit; font-size: 14.5px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .12s, filter .15s;
}
.r-btn:hover { background: var(--r-surface-2); }
.r-btn:active { transform: scale(.97); }
.r-btn:focus-visible { outline: none; box-shadow: var(--r-focus); }

.r-btn-primary {
  border: 0;
  background: linear-gradient(180deg, var(--r-gold-soft), var(--r-gold));
  color: var(--r-on-accent);
  font-weight: 700;
  box-shadow: var(--r-shadow);
}
.r-btn-primary:hover { filter: brightness(1.05); background: linear-gradient(180deg, var(--r-gold-soft), var(--r-gold)); }

.r-btn-cta {
  border: 0;
  background: linear-gradient(180deg, var(--r-cta-2), var(--r-cta));
  color: #f7edd8; font-weight: 700;
}

.r-btn-ghost { background: transparent; }
.r-btn-ghost:hover { background: var(--r-accent-soft); }

.r-btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: var(--r-radius-sm); }
.r-btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }

/* ── surfaces ──────────────────────────────────────────────────────────── */
.r-card {
  background: var(--r-surface);
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius-lg);
  box-shadow: var(--r-shadow);
  padding: var(--r-space-5);
}
.r-card-flat { box-shadow: none; }

/* ── form controls ─────────────────────────────────────────────────────── */
.r-input, .r-textarea, .r-select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--r-line-strong);
  border-radius: var(--r-radius);
  background: var(--r-surface);
  font-family: inherit; font-size: 15px; color: var(--r-ink);
}
.r-input::placeholder, .r-textarea::placeholder { color: var(--r-muted); }
.r-input:focus, .r-textarea:focus, .r-select:focus {
  outline: none; border-color: var(--r-accent); box-shadow: var(--r-focus);
}
.r-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--r-ink-soft); }
.r-note { font-size: 12.5px; color: var(--r-muted); }

/* ── badges / pills / status ───────────────────────────────────────────── */
.r-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--r-mono); font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-radius-pill);
  background: var(--r-accent-soft); color: var(--r-accent);
}
.r-badge-ok     { background: var(--r-ok-soft);     color: var(--r-ok); }
.r-badge-danger { background: var(--r-danger-soft); color: var(--r-danger); }
.r-badge-muted  { background: var(--r-surface-2);   color: var(--r-muted); }
.r-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--r-ok); display: inline-block; }

/* ── feedback ──────────────────────────────────────────────────────────── */
.r-alert {
  border-radius: var(--r-radius); padding: 11px 14px; font-size: 13.5px;
  border: 1px solid var(--r-line);
}
.r-alert-error { background: var(--r-danger-soft); border-color: var(--r-danger); color: var(--r-danger); }
.r-alert-ok    { background: var(--r-ok-soft);     border-color: var(--r-ok);     color: var(--r-ok); }

/* ── skeleton loader (UX guideline: show state > 300ms) ────────────────── */
.r-skeleton {
  background: linear-gradient(90deg, var(--r-surface-2) 25%, var(--r-bg-2) 37%, var(--r-surface-2) 63%);
  background-size: 400% 100%;
  border-radius: var(--r-radius-sm);
  animation: r-shimmer 1.4s ease infinite;
}
@keyframes r-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ── header (brand bar) — reads tokens, works on both surfaces ─────────── */
.r-header {
  height: var(--r-header);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: linear-gradient(180deg, #1c120a 0%, var(--r-espresso) 55%, #241708 100%);
  border-bottom: 1px solid rgba(201, 163, 92, .35);
  color: var(--r-gold-soft);
  position: sticky; top: 0; z-index: 40;
}
.r-header .r-logo {
  font-family: var(--r-serif); font-size: 21px; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(120deg, #e8cf9a, #f7ecd0 35%, var(--r-gold) 60%, #f2e2b8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.r-header .r-spacer { flex: 1; }

.r-iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--r-line-strong); border-radius: 11px;
  background: var(--r-surface); color: var(--r-ink);
  cursor: pointer; transition: background .15s, transform .12s;
}
.r-iconbtn:hover { background: var(--r-surface-2); }
.r-iconbtn:active { transform: scale(.94); }
.r-iconbtn:focus-visible { outline: none; box-shadow: var(--r-focus); }

/* ── utilities ─────────────────────────────────────────────────────────── */
.r-stack   { display: flex; flex-direction: column; gap: var(--r-space-4); }
.r-row     { display: flex; align-items: center; gap: var(--r-space-3); }
.r-wrap    { max-width: 1100px; margin-inline: auto; padding-inline: var(--r-space-5); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
