/* ============================================================
   RatedYou — stile "Aria" per l'area utente web (/pwa).
   Stessi valori del restyle Aria dell'app Android
   (MerchantDashboardScreen.kt, fragment_home_cliente.xml):
   bianco, testo #222, viola #6A1B9A solo come accento,
   righe piatte con divisori, CTA a pillola scura, icone Material.
   Su schermi larghi l'app resta una colonna centrata come sul telefono.
   ============================================================ */

:root {
  --ry-accent: #6A1B9A;
  --ry-accent-tint: #F3E5F5;
  --ry-ink: #222222;
  --ry-ink-2: #717171;
  --ry-ink-3: #B0B0B0;
  --ry-line: #EBEBEB;
  --ry-input-line: #E3E3E3;
  --ry-soft: #F7F7F7;
  --ry-chevron: #C9C4D2;
  --ry-success: #008A05;
  --ry-star: #F9A825;
  --ry-danger: #B0223F;
  --ry-page: #FFFFFF;
  --ry-backdrop: #F2F1F4;
  --ry-col: 480px;
  --ry-gutter: 16px;
  --ry-nav-h: 64px;
  --ry-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  font-family: var(--ry-font);
  color: var(--ry-ink);
  background: var(--ry-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font-family: inherit; color: inherit; }
a { color: inherit; }

/* ── Guscio: colonna centrata ─────────────────────────────── */
.ry-app {
  max-width: var(--ry-col);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--ry-page);
  padding-bottom: calc(var(--ry-nav-h) + 24px + env(safe-area-inset-bottom));
  position: relative;
}
@media (min-width: 600px) {
  body { background: var(--ry-backdrop); }
  .ry-app { border-left: 1px solid var(--ry-line); border-right: 1px solid var(--ry-line); }
}

/* ── Icone Material Symbols ───────────────────────────────── */
.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal; font-style: normal;
  font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none; flex-shrink: 0;
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* ── Barra in alto ────────────────────────────────────────── */
.ry-topbar {
  position: sticky; top: 0; z-index: 50;
  height: 56px; padding: 0 8px 0 var(--ry-gutter);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
}
.ry-topbar.scrolled { border-bottom-color: var(--ry-line); }
.ry-wordmark { font-size: 20px; font-weight: 900; color: var(--ry-accent); letter-spacing: -0.3px; line-height: 1; }
.ry-wordmark-sub { font-size: 11px; color: #9A93A8; margin-top: 2px; font-weight: 500; }
.ry-icon-btn {
  width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ry-ink); position: relative;
}
.ry-icon-btn:hover { background: var(--ry-soft); }
.ry-icon-btn:focus-visible, .ry-row:focus-visible, .ry-pill-btn:focus-visible,
.ry-circle-act:focus-visible, .ry-nav-item:focus-visible, .ry-link:focus-visible {
  outline: 2px solid var(--ry-accent); outline-offset: 2px;
}
.ry-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #E53935; border: 2px solid #fff; }

/* ── Tipografia ───────────────────────────────────────────── */
.ry-h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
.ry-h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.ry-section-title { font-size: 19px; font-weight: 800; letter-spacing: -0.2px; }
.ry-caps { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ry-ink-2); }
.ry-muted { color: var(--ry-ink-2); font-size: 13px; line-height: 1.45; }
.ry-meta { color: var(--ry-ink-3); font-size: 12px; }
.ry-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ry-ink);
  text-decoration: underline; text-underline-offset: 3px;
}

/* ── Sezioni ──────────────────────────────────────────────── */
.ry-pad { padding: 0 var(--ry-gutter); }
.ry-section { padding: 24px var(--ry-gutter) 8px; }
.ry-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ry-band { height: 8px; background: var(--ry-soft); margin: 16px 0 0; }
.ry-divider { height: 1px; background: var(--ry-line); margin: 0 var(--ry-gutter); }

/* ── Hero ─────────────────────────────────────────────────── */
.ry-hero { padding: 12px var(--ry-gutter) 20px; display: flex; align-items: center; gap: 16px; }
.ry-hero-body { flex: 1; min-width: 0; }
.ry-hero-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ry-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--ry-accent-tint); color: var(--ry-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; overflow: hidden;
}
.ry-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ry-avatar.sm { width: 44px; height: 44px; font-size: 16px; }

.ry-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px; border-radius: 13px;
  border: 1px solid var(--ry-line); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--ry-ink); white-space: nowrap;
}
.ry-chip .ms { font-size: 16px; }
.ry-chip .star { color: var(--ry-star); }
.ry-level-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Statistiche in riga, separate da divisori verticali */
.ry-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 0; margin: 0 var(--ry-gutter); border-top: 1px solid var(--ry-line); border-bottom: 1px solid var(--ry-line); }
.ry-stat { text-align: center; position: relative; }
.ry-stat + .ry-stat::before { content: ""; position: absolute; left: 0; top: 4px; height: 34px; width: 1px; background: var(--ry-line); }
.ry-stat-val { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.ry-stat-lbl { font-size: 11px; color: var(--ry-ink-2); margin-top: 2px; }

/* Barra di avanzamento sottile */
.ry-progress { height: 3px; border-radius: 3px; background: var(--ry-line); overflow: hidden; }
.ry-progress > span { display: block; height: 100%; background: var(--ry-accent); border-radius: 3px; transition: width .6s ease; }

/* ── Saldo ────────────────────────────────────────────────── */
.ry-balance { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin-top: 4px; }
.ry-balance small { font-size: 16px; font-weight: 700; letter-spacing: 0; margin-left: 4px; }
.ry-meta-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--ry-ink-2); }
.ry-meta-row .sep { color: var(--ry-ink-3); }
.ry-green { color: var(--ry-success); font-weight: 600; }

/* ── Striscia (notifiche) ─────────────────────────────────── */
.ry-strip {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--ry-soft); border: 0; border-radius: 12px;
  padding: 14px 16px; cursor: pointer; text-align: left;
  font-size: 14px; font-weight: 600;
}
.ry-strip .grow { flex: 1; }

/* ── Righe piatte ─────────────────────────────────────────── */
.ry-list { border-top: 1px solid var(--ry-line); }
.ry-list.no-top { border-top: 0; }
.ry-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 0; background: none; border: 0; border-bottom: 1px solid var(--ry-line);
  cursor: pointer; text-align: left; text-decoration: none; color: inherit;
}
.ry-row:last-child { border-bottom: 0; }
.ry-row:hover .ry-row-title { text-decoration: underline; text-underline-offset: 3px; }
.ry-row-icon { width: 22px; color: var(--ry-ink); }
.ry-row-body { flex: 1; min-width: 0; }
.ry-row-title { font-size: 15px; font-weight: 600; }
.ry-row-sub { font-size: 12.5px; color: var(--ry-ink-2); margin-top: 2px; line-height: 1.4; }
.ry-row-sub.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ry-chev { color: var(--ry-chevron); font-size: 22px; }
.ry-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #EFEDF2; flex-shrink: 0; }

/* ── Pulsanti ─────────────────────────────────────────────── */
.ry-pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 26px; border: 0; cursor: pointer;
  background: var(--ry-ink); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
a.ry-pill-btn, a.ry-google-btn, a.ry-icon-btn, a.ry-row, a.ry-nav-item { text-decoration: none; }
.ry-pill-btn:hover { background: #000; }
.ry-pill-btn.block { width: 100%; }
.ry-pill-btn.tall { height: 64px; border-radius: 32px; justify-content: flex-start; padding: 0 20px 0 12px; }
.ry-pill-btn.small { height: 36px; padding: 0 16px; font-size: 13px; border-radius: 18px; box-shadow: none; }
.ry-pill-btn.outline { background: #fff; color: var(--ry-ink); border: 1px solid var(--ry-ink); box-shadow: none; }
.ry-pill-btn.outline:hover { background: var(--ry-soft); }
.ry-pill-btn.danger { background: #fff; color: var(--ry-danger); border: 1px solid var(--ry-danger); box-shadow: none; }
.ry-pill-btn.danger:hover { background: #FCEFF2; }
.ry-cta-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.ry-cta-text { flex: 1; text-align: left; }
.ry-cta-title { font-size: 17px; font-weight: 800; }
.ry-cta-sub { font-size: 12px; font-weight: 500; opacity: .75; margin-top: 2px; }

/* Azioni rotonde (4 per riga) */
.ry-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ry-circle-act { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0; position: relative; }
.ry-circle-act .circle { width: 54px; height: 54px; border-radius: 50%; background: var(--ry-soft); display: flex; align-items: center; justify-content: center; }
.ry-circle-act:hover .circle { background: #EFEFEF; }
.ry-circle-act .lbl { font-size: 12px; font-weight: 600; color: var(--ry-ink); text-align: center; line-height: 1.2; }

/* ── Campo di ricerca a pillola ───────────────────────────── */
.ry-search {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px;
  background: #fff; border: 1px solid var(--ry-input-line); border-radius: 26px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.ry-search:focus-within { border-color: var(--ry-ink); }
.ry-search input { border: 0; outline: 0; flex: 1; font-size: 15px; background: transparent; min-width: 0; }
.ry-search .ms { color: var(--ry-ink-2); }

/* ── Card con foto ────────────────────────────────────────── */
.ry-photo-card {
  position: relative; display: block; width: 100%; height: 190px; border-radius: 18px; overflow: hidden;
  border: 0; padding: 0; cursor: pointer; background: #EFEDF2; color: #fff; text-align: left;
}
.ry-photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ry-photo-card .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.62) 100%); }
.ry-photo-card .content { position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: flex-end; gap: 12px; }
.ry-photo-card .title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; flex: 1; }
.ry-photo-card .pill { position: absolute; top: 14px; left: 14px; background: #fff; color: var(--ry-ink); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; padding: 5px 10px; border-radius: 12px; }
.ry-photo-card .go { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ry-ink); display: flex; align-items: center; justify-content: center; }

.ry-hscroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--ry-gutter)); padding: 0 var(--ry-gutter) 4px; scroll-snap-type: x mandatory; }
.ry-hscroll::-webkit-scrollbar { display: none; }
.ry-mini-card { flex: 0 0 140px; scroll-snap-align: start; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.ry-mini-card img { width: 140px; height: 110px; border-radius: 16px; object-fit: cover; display: block; background: #EFEDF2; }
.ry-mini-card .cap { font-size: 14px; font-weight: 600; margin-top: 8px; }
.ry-mini-card .sub { font-size: 12px; color: var(--ry-ink-2); margin-top: 1px; }

/* ── Pillola QR flottante (cliente) ───────────────────────── */
.ry-fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--ry-nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 60;
  height: 52px; padding: 0 22px; border-radius: 26px; border: 0; cursor: pointer;
  background: var(--ry-ink); color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .8px;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}
.ry-fab:hover { background: #000; }

/* ── Navigazione in basso ─────────────────────────────────── */
.ry-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--ry-col); z-index: 70;
  height: calc(var(--ry-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--ry-line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.ry-nav-item {
  background: none; border: 0; cursor: pointer; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #8E8E93; font-size: 11px; font-weight: 600;
}
.ry-nav-item .ms { font-size: 24px; }
.ry-nav-item.active { color: var(--ry-ink); }
.ry-nav-item.active .ms { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* ── Menu a tendina ───────────────────────────────────────── */
.ry-menu {
  display: none; position: fixed; z-index: 90; min-width: 220px;
  background: #fff; border-radius: 14px; padding: 6px 0;
  box-shadow: 0 10px 34px rgba(0,0,0,.18); border: 1px solid var(--ry-line);
}
.ry-menu.open { display: block; }
.ry-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; background: none; border: 0; cursor: pointer; font-size: 15px; font-weight: 500; text-align: left; }
.ry-menu-item:hover { background: var(--ry-soft); }
.ry-menu-item .ms { font-size: 20px; color: var(--ry-ink-2); }
.ry-menu-sep { height: 1px; background: var(--ry-line); margin: 6px 0; }
.ry-menu-item.danger, .ry-menu-item.danger .ms { color: var(--ry-danger); }

/* ── Modale ───────────────────────────────────────────────── */
.ry-modal { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); align-items: center; justify-content: center; padding: 20px; }
.ry-modal.open { display: flex; }
.ry-modal-box { background: #fff; border-radius: 24px; padding: 28px 24px 22px; width: 100%; max-width: 340px; text-align: center; animation: ryPop .25s ease-out; }
@keyframes ryPop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Stato vuoto, toast, caricamento, piè di pagina ───────── */
.ry-empty { padding: 22px 0; text-align: center; color: var(--ry-ink-2); font-size: 13px; }
.ry-empty .ms { display: block; margin: 0 auto 8px; font-size: 28px; color: var(--ry-ink-3); }
.ry-toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(var(--ry-nav-h) + 84px + env(safe-area-inset-bottom));
  background: var(--ry-ink); color: #fff; padding: 12px 20px; border-radius: 24px;
  font-size: 14px; display: none; max-width: calc(100vw - 32px); text-align: center;
}
.ry-loading { position: fixed; inset: 0; z-index: 300; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.ry-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--ry-accent-tint); border-top-color: var(--ry-accent); animation: rySpin .8s linear infinite; }
@keyframes rySpin { to { transform: rotate(360deg); } }
.ry-trust { padding: 28px var(--ry-gutter) 8px; text-align: center; }
.ry-trust .ry-caps { color: var(--ry-ink-3); display: inline-flex; align-items: center; gap: 6px; }
.ry-trust .ms { font-size: 16px; }
.ry-trust p { font-size: 12px; color: #BBBBBB; margin-top: 6px; }

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

/* Segnaposto per foto non disponibili */
.ry-img-ph { display: flex; align-items: center; justify-content: center; background: #EFEDF2; color: var(--ry-ink-3); }
.ry-mini-card .ry-img-ph { width: 140px; height: 110px; border-radius: 16px; }
.ry-img-ph .ms { font-size: 26px; }
/* Spazio per la pillola QR flottante */
.ry-app.has-fab { padding-bottom: calc(var(--ry-nav-h) + 96px + env(safe-area-inset-bottom)); }

/* ── Moduli (accesso, registrazione) ──────────────────────── */
.ry-field { display: block; margin-bottom: 12px; }
.ry-field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ry-field input {
  width: 100%; height: 52px; padding: 0 16px; font-size: 16px;
  border: 1px solid var(--ry-input-line); border-radius: 12px; background: #fff; outline: 0;
}
.ry-field input:focus { border-color: var(--ry-ink); box-shadow: 0 0 0 3px rgba(34,34,34,.08); }
.ry-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  height: 52px; border-radius: 26px; border: 1px solid var(--ry-input-line); background: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.ry-google-btn:hover { background: var(--ry-soft); }
.ry-or { display: flex; align-items: center; gap: 12px; color: var(--ry-ink-3); font-size: 12px; margin: 20px 0; }
.ry-or::before, .ry-or::after { content: ""; flex: 1; height: 1px; background: var(--ry-line); }
.ry-alert { display: none; padding: 12px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.4; }
.ry-alert.err { display: block; background: #FCEFF2; color: var(--ry-danger); }
.ry-alert.ok { display: block; background: #EAF6EA; color: var(--ry-success); }
.ry-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ry-tile { border: 1px solid var(--ry-line); border-radius: 16px; padding: 16px 14px; }
.ry-tile .ms { font-size: 24px; color: var(--ry-accent); }
.ry-tile b { display: block; font-size: 14px; margin-top: 8px; }
.ry-tile p { font-size: 12.5px; color: var(--ry-ink-2); margin-top: 4px; line-height: 1.45; }
.ry-footer-links { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--ry-ink-2); padding: 8px 0 24px; }
.ry-footer-links a { color: var(--ry-ink-2); }

/* Numero non letti sulla voce di navigazione */
.ry-nav-item { position: relative; }
.ry-nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--ry-accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
