/* Buongiorno Radio - tema condiviso da tutte le pagine (principale, profilo, prezzi).
   Nessun font o file esterno: tutto resta sul nostro sito (niente tracciamento di terzi). */

:root {
  --bg: #110e0c;
  --surface: #1b1613;
  --surface-2: #251e19;
  --line: #3a2f27;
  --text: #f7f0e8;
  --muted: #b3a597;
  --accent: #f5a54a;
  --accent-2: #ee7b3c;
  --accent-soft: rgba(245, 165, 74, .14);
  --ok: #7bc47f;
  --err: #ef6f62;
  --radius: 18px;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.55 var(--sans);
  background:
    radial-gradient(900px 420px at 85% -80px, rgba(238, 123, 60, .22), transparent 70%),
    radial-gradient(700px 380px at -10% 0, rgba(245, 165, 74, .12), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.01em; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 56px; }

/* ---------- Intestazione ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(17, 14, 12, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(58, 47, 39, .7);
}
.topbar .in { max-width: 820px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 18px rgba(238, 123, 60, .35);
}
.brand .mark svg { width: 20px; height: 20px; }
.brand b { font-family: var(--serif); font-size: 1.15rem; letter-spacing: -.01em; }
.topnav { display: flex; align-items: center; gap: 14px; }
.topnav > a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.topnav > a:hover { color: var(--text); }

/* ---------- Avatar e menu ---------- */
.usermenu { position: relative; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .14); cursor: pointer;
  display: grid; place-items: center; color: #fff; font: 700 .95rem var(--sans); letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); padding: 0;
}
.avatar:hover, .avatar[aria-expanded="true"] { border-color: var(--accent); }
.avatar.xl { width: 76px; height: 76px; font-size: 1.7rem; cursor: default; border-width: 3px; }
.menu {
  position: absolute; right: 0; top: 50px; min-width: 230px; padding: 8px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who small { display: block; color: var(--muted); font-size: .78rem; }
.menu .who span { display: block; font-size: .9rem; word-break: break-all; }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 10px; border-radius: 9px; border: 0; background: none;
  color: var(--text); text-decoration: none; font: inherit; font-size: .94rem; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--accent-soft); }
.menu .danger { color: var(--err); }

/* ---------- Titoli di pagina ---------- */
.hero { padding: 30px 0 6px; }
.hero h1 { margin: 0; font-size: clamp(1.8rem, 5.5vw, 2.5rem); line-height: 1.1; }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 52ch; }
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; vertical-align: middle; margin-left: 10px; }
.eq i { width: 4px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent-2)); animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; animation-delay: -.2s; }
.eq i:nth-child(2) { height: 90%; animation-delay: -.5s; }
.eq i:nth-child(3) { height: 60%; animation-delay: -.8s; }
.eq i:nth-child(4) { height: 100%; animation-delay: -.35s; }
.eq i:nth-child(5) { height: 50%; animation-delay: -.65s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.eq i { transform-origin: bottom; }
.eq.paused i { animation-play-state: paused; transform: scaleY(.35); }
.badge { display: inline-block; margin-top: 12px; padding: 3px 11px; border-radius: 999px; font-size: .78rem; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(245, 165, 74, .35); }

/* ---------- Carte ---------- */
.card { background: linear-gradient(180deg, var(--surface), #17120f); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 18px; }
.card > h2 { margin: 0 0 4px; font-size: 1.25rem; }
.card > .sub { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.step { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 .82rem var(--sans); background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(245, 165, 74, .4); flex: none; }
.step h2 { margin: 0; font-size: 1.12rem; }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

/* ---------- Pulsanti e campi ---------- */
button.btn, a.btn {
  display: inline-block; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; text-align: center; text-decoration: none;
  font: 600 .95rem var(--sans); background: var(--surface-2); color: var(--text); transition: transform .08s, border-color .15s;
}
button.btn:hover, a.btn:hover { border-color: var(--accent); }
button.btn:active { transform: scale(.98); }
button.primary, a.btn.primary {
  width: 100%; margin-top: 18px; padding: 15px; font-size: 1.05rem; border: 0; color: #1c1108;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px rgba(238, 123, 60, .28);
}
button.primary:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: default; }
button.btn.small { padding: 6px 12px; font-size: .85rem; }

input[type=text], input[type=password], input[type=email], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #120e0c; color: var(--text); font: inherit;
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { min-height: 110px; resize: vertical; }
label.lbl { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .88rem; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.hint { margin-top: 8px; text-align: center; color: var(--muted); font-size: .88rem; min-height: 1.3em; }
.hint.left { text-align: left; }
.msg { margin-top: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: .92rem; }
.msg.ok { border-color: #3d6b3d; color: #9ad79a; }
.msg.err { border-color: #7a3a33; color: #f4a89e; }

/* ---------- Argomenti (chip) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font: 500 .95rem var(--sans); cursor: pointer; user-select: none; transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #1c1108; font-weight: 700; }
.chip.off { opacity: .45; }
.tabs { display: flex; gap: 8px; margin-bottom: 6px; }

/* ---------- Barra del piano ---------- */
.planbar {
  margin-top: 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between;
}
.planbar b { color: var(--text); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #1c1108; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ---------- Interruttore ---------- */
.switch { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; cursor: pointer; font-size: .94rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .2s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .45; }

.terms { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; font-size: .88rem; color: var(--muted); }
.terms input { width: 18px; height: 18px; margin-top: 3px; flex: none; }

/* ---------- Episodi / lettore ---------- */
.ep { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.ep:first-child { border-top: 0; padding-top: 4px; }
.play {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(238, 123, 60, .3);
}
.play svg { width: 22px; height: 22px; fill: #1c1108; }
.play .i-pause { display: none; }
.play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }
.play.wait { background: var(--surface-2); box-shadow: none; cursor: default; border: 1px solid var(--line); }
.play.wait svg { fill: var(--muted); }
.ep .body { flex: 1; min-width: 0; }
.ai-tag { display: inline-block; margin-top: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; color: var(--muted); }
.ep h3 { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.meta { color: var(--muted); font-size: .82rem; margin: 3px 0 8px; }
.seek { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek input[type=range] { flex: 1; accent-color: var(--accent); height: 4px; }
.ep .tools { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85rem; align-items: center; }
.ep .tools a { color: var(--muted); }
.status { font-size: .9rem; }
.status.running, .status.queued { color: var(--accent); }
.status.error { color: var(--err); }
.bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
details summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.srcs { margin: 8px 0 0; padding-left: 18px; font-size: .86rem; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-size: .9rem; }

/* ---------- Pie di pagina ---------- */
.legal-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; text-align: center; }
.legal-foot a { color: var(--muted); }
.legal-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  .eq i, .bar i { animation: none; }
  * { transition: none !important; }
}
