/* AbilityRoom — Componenti "Carta & Inchiostro". Bordi pieni, ombre nette, tatto. */

/* ---------------- Bottoni ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; line-height: 1;
  padding: .8rem 1.4rem; border-radius: 12px; border: var(--bd); cursor: pointer;
  white-space: nowrap; text-decoration: none; color: var(--ink); background: var(--card);
  box-shadow: var(--sh); transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--sh-sm); }
.btn i, .btn svg { width: 1.15em; height: 1.15em; }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra); color: #fff; }
.btn-coral { background: var(--pine); color: #fff; }
.btn-coral:hover { color: #fff; }
.btn-outline { background: var(--card); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; box-shadow: none; padding-inline: .9rem; }
.btn-ghost:hover { background: var(--paper-2); color: var(--terra-ink); box-shadow: none; transform: none; }
.btn-ghost:active { transform: none; box-shadow: none; }
.btn-danger { background: var(--card); color: var(--error); }
.btn-danger:hover { background: var(--error-bg); }
.btn-light { background: var(--ochre); color: var(--ink); }
.btn-sm { padding: .5rem .9rem; font-size: .88rem; border-radius: 10px; box-shadow: var(--sh-sm); }
.btn-sm:hover { box-shadow: var(--sh); }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn.is-loading { pointer-events: none; position: relative; color: transparent !important; }
.btn.is-loading::after { content: ''; position: absolute; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after, .btn-ghost.is-loading::after, .btn-danger.is-loading::after, .btn-light.is-loading::after { border-color: rgba(34, 31, 27, .25); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Card ---------------- */
.card { background: var(--card); border: var(--bd); border-radius: var(--radius); padding: var(--sp-4); box-shadow: var(--shadow); }
.card-hover { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.card-hover:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }

/* pittogramma quadrato (tinta piena + bordo inchiostro) */
.pic { width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; border: var(--bd); box-shadow: var(--sh-sm); background: var(--terra); }
.pic i, .pic svg { width: 1.45rem; height: 1.45rem; }
.pic-lg { width: 3.6rem; height: 3.6rem; }

/* ---------------- Chip / badge ---------------- */
.chip { font-family: var(--font-head); font-weight: 600; font-size: .88rem; padding: .45rem 1rem; border-radius: var(--radius-pill); background: var(--card); border: var(--bd); color: var(--ink); cursor: pointer; transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .15s; user-select: none; }
.chip:hover { transform: translate(-1px, -1px); box-shadow: var(--sh-sm); }
.chip.is-active { background: var(--terra); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; font-family: var(--font-head); padding: .25rem .65rem; border-radius: var(--radius-pill); background: var(--paper-2); color: var(--ink); border: 1.5px solid var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn { background: #fdf0d6; color: #9a6413; }
.badge-danger { background: var(--error-bg); color: var(--error); }
.badge-muted { background: var(--paper-2); color: var(--ink-soft); }

/* ---------------- Navbar pubblica ---------------- */
.nav { position: sticky; top: 0; z-index: var(--z-nav); background: var(--paper); border-bottom: var(--bd); transition: box-shadow .3s var(--ease); }
.nav.scrolled { box-shadow: 0 6px 0 -2px rgba(34, 31, 27, .08); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--topbar-h); }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); letter-spacing: -.02em; }
.logo .mark { width: 2.5rem; height: 2.5rem; border-radius: 10px; background: var(--terra); border: var(--bd); display: grid; place-items: center; color: #fff; box-shadow: var(--sh-sm); }
.logo .mark i, .logo .mark svg { width: 1.35rem; height: 1.35rem; }
.nav-links { display: flex; align-items: center; gap: .2rem; list-style: none; padding: 0; margin: 0; }
.nav-links a { font-family: var(--font-head); font-weight: 600; font-size: .95rem; color: var(--ink); padding: .45rem .8rem; border-radius: 9px; }
.nav-links a:hover { background: var(--paper-2); }
.nav-links a.active { box-shadow: inset 0 -3px 0 var(--terra); }
.nav-cta { display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; background: var(--card); border: var(--bd); border-radius: 9px; cursor: pointer; padding: .35rem; color: var(--ink); box-shadow: var(--sh-sm); }
.nav-toggle i, .nav-toggle svg { width: 1.5rem; height: 1.5rem; }
.nav-drawer { display: none; }

@media (max-width: 900px) {
  .nav-links, .nav-cta.desktop { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-drawer { position: fixed; inset: var(--topbar-h) 0 auto 0; background: var(--paper); border-bottom: var(--bd); padding: 1rem clamp(1.1rem, 4vw, 2rem) 1.6rem; box-shadow: var(--sh-soft); transform: translateY(-120%); transition: transform .35s var(--ease); z-index: var(--z-nav); }
  .nav-drawer.open { display: block; transform: translateY(0); }
  .nav-drawer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .2rem; }
  .nav-drawer a { display: block; font-family: var(--font-head); font-weight: 600; color: var(--ink); padding: .8rem .6rem; border-radius: 9px; }
  .nav-drawer a:hover { background: var(--paper-2); }
  .nav-drawer .nav-cta { flex-direction: column; align-items: stretch; }
}

/* ---------------- Footer ---------------- */
.footer { background: var(--ink); color: rgba(251, 245, 234, .68); padding: clamp(3rem, 6vw, 4rem) 0 2rem; }
.footer a { color: rgba(251, 245, 234, .68); }
.footer a:hover { color: var(--ochre); }
.footer .logo { color: var(--paper); }
.footer .logo .mark { border-color: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.footer h4 { color: var(--paper); font-size: 1rem; margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(251, 245, 234, .15); font-size: .85rem; text-align: center; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; } }

/* ---------------- Form group ---------------- */
.field { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.field .help { font-size: .82rem; color: var(--muted); }
.field .err { font-size: .84rem; color: var(--error); font-weight: 600; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); box-shadow: 3px 3px 0 var(--error); }
.field.invalid .err { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-msg { display: none; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 600; margin-top: .4rem; border: 1.5px solid var(--ink); }
.form-msg.ok { display: block; background: var(--success-bg); color: var(--success); }
.form-msg.err { display: block; background: var(--error-bg); color: var(--error); }

/* ---------------- Modal ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(34, 31, 27, .55); display: grid; place-items: center; padding: 1.2rem; z-index: var(--z-overlay); opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s; }
.overlay.open { opacity: 1; visibility: visible; }
.modal-card { background: var(--card); border: var(--bd); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.2rem); width: 100%; max-width: 30rem; box-shadow: var(--shadow-lg); transform: translate(0, 14px); transition: transform .25s var(--ease); max-height: 90vh; overflow-y: auto; }
.overlay.open .modal-card { transform: none; }
.modal-card h3 { margin-bottom: .4rem; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: var(--paper-2); border: 1.5px solid var(--ink); width: 2.2rem; height: 2.2rem; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--ink); font-size: 1.1rem; }
.modal-close:hover { background: var(--ochre); }
.modal-wrap { position: relative; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: var(--z-toast); display: flex; flex-direction: column; gap: .6rem; max-width: min(24rem, 92vw); }
.toast { display: flex; align-items: flex-start; gap: .7rem; background: var(--card); border: var(--bd); border-left-width: 6px; border-radius: var(--radius-sm); padding: .85rem 1rem; box-shadow: var(--shadow); font-size: .92rem; color: var(--ink); animation: toastIn .3s var(--ease); }
.toast.ok { border-left-color: var(--pine); }
.toast.err { border-left-color: var(--error); }
.toast i, .toast svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; margin-top: .1rem; }
.toast.ok i { color: var(--pine); } .toast.err i { color: var(--error); } .toast i { color: var(--terra); }
@keyframes toastIn { from { transform: translate(20px, 0); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: var(--bd); margin-bottom: 1.4rem; }
.tab { font-family: var(--font-head); font-weight: 700; font-size: .92rem; color: var(--ink-soft); background: none; border: none; padding: .7rem 1rem; cursor: pointer; border-radius: 9px 9px 0 0; position: relative; transition: color .15s var(--ease), background .15s; }
.tab:hover { color: var(--ink); background: var(--paper-2); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after { content: ''; position: absolute; left: .5rem; right: .5rem; bottom: -2px; height: 4px; background: var(--terra); border-radius: 3px 3px 0 0; }
.tab-panel { display: none; animation: fadeUp .3s var(--ease); }
.tab-panel.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- Accordion ---------------- */
.acc-item { border: var(--bd); border-radius: var(--radius-sm); margin-bottom: .7rem; overflow: hidden; background: var(--card); box-shadow: var(--sh-sm); }
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: 1rem 1.2rem; background: none; border: none; cursor: pointer; font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--ink); text-align: left; }
.acc-head:hover { background: var(--paper-2); }
.acc-head .chev { transition: transform .3s var(--ease); color: var(--terra); flex: 0 0 auto; }
.acc-item.open .chev { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.acc-body-inner { padding: 0 1.2rem 1.2rem; color: var(--ink-soft); }

/* ---------------- Tooltip ---------------- */
.tip { position: relative; display: inline-flex; }
.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + .5rem); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--ink); color: var(--paper); font-size: .78rem; font-weight: 600; padding: .4rem .65rem; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); z-index: var(--z-toast); }
.tip:hover::after { opacity: 1; transform: translateX(-50%); }

/* ---------------- Dropdown ---------------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + .5rem); background: var(--card); border: var(--bd); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .4rem; min-width: 12rem; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s; z-index: var(--z-overlay); }
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .7rem; border-radius: 8px; font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--ink); background: none; border: none; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--paper-2); color: var(--terra-ink); }
.dropdown-menu i, .dropdown-menu svg { width: 1.05rem; height: 1.05rem; }
.dropdown-divider { height: 1.5px; background: var(--line); margin: .35rem 0; }

/* ---------------- Empty / spinner ---------------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .pic { margin: 0 auto 1rem; background: var(--ochre); color: var(--ink); }
.spinner { width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--terra); animation: spin .7s linear infinite; margin: 2rem auto; }

/* ---------------- Card prodotto / pacchetto (condivise home + marketplace) ---------------- */
.prod { display: flex; flex-direction: column; gap: .6rem; background: var(--card); border: var(--bd); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); transition: transform .18s var(--ease), box-shadow .18s var(--ease); height: 100%; }
.prod:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }
.prod h4 { font-size: 1.12rem; }
.prod p { font-size: .92rem; color: var(--ink-soft); }
.prod .price { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; margin-top: auto; padding-top: .4rem; color: var(--ink); }
.prod .price small { font-size: .8rem; font-weight: 600; color: var(--muted); font-family: var(--font-head); }

.pk { display: flex; flex-direction: column; gap: .5rem; background: var(--card); border: var(--bd); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); transition: transform .18s var(--ease), box-shadow .18s var(--ease); height: 100%; }
.pk:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }
.pk ul { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-direction: column; gap: .5rem; }
.pk ul li { position: relative; padding-left: 1.7rem; font-size: .92rem; color: var(--ink-soft); }
.pk ul li::before { content: ''; position: absolute; left: 0; top: .15rem; width: 1.15rem; height: 1.15rem; border-radius: 5px; background: var(--pine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / .75rem no-repeat; border: 1.5px solid var(--ink); }
.pk .price { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; margin-top: auto; padding-top: .4rem; }

.price-amount { font-family: var(--font-display); font-weight: 600; }
.prose p { margin-bottom: .8rem; color: var(--ink-soft); }
.prose ul, .prose ol { margin-bottom: .8rem; display: flex; flex-direction: column; gap: .4rem; }
kbd { font-family: var(--font-head); font-size: .82rem; background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 5px; padding: .1rem .4rem; color: var(--ink); }
