/* ==========================================================================
   Circolo Ufficiali Marina Militare "Paolo Vandone" — Augusta
   Foglio di stile unico del sito (nessuna dipendenza esterna).
   ========================================================================== */

:root {
  --navy: #0d3b73;
  --navy-deep: #07264a;
  --navy-soft: #16508f;
  --gold: #c19a45;
  --gold-light: #e3c988;
  --ink: #16233a;
  --muted: #586a83;
  --line: #e2e6ee;
  --paper: #ffffff;
  --sand: #f6f3ec;
  --sand-2: #efeade;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(9, 30, 60, .06), 0 6px 18px rgba(9, 30, 60, .06);
  --shadow-md: 0 2px 6px rgba(9, 30, 60, .07), 0 18px 40px rgba(9, 30, 60, .10);
  --wrap: 1120px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-soft); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.18;
  color: var(--navy-deep);
  letter-spacing: .01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: .7rem 1rem;
  z-index: 50;
}
.skip-link:focus { left: .5rem; top: .5rem; color: #fff; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Intestazione ------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(9, 30, 60, .03);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: .6rem 1.6rem;
  flex-wrap: wrap;
  padding-block: .7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.brand-eyebrow {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--navy-deep);
  letter-spacing: .02em;
}

.site-nav {
  /* Come elemento flex può restringersi sotto la propria larghezza massima:
     senza min-width: 0 la barra forzerebbe l'overflow orizzontale su mobile. */
  min-width: 0;
  flex: 1 1 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: .42rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
}

@media (min-width: 900px) {
  .site-nav { flex: 0 1 auto; margin-left: auto; }
  .site-nav a { font-size: .82rem; padding: .5rem .7rem; }
  .site-nav ul { gap: .25rem .35rem; }
}

.site-nav a:hover { background: var(--sand); }

.site-nav a[aria-current="page"] {
  background: var(--navy);
  color: #fff;
}

/* ---------- Accesso all'area amministratore ------------------------------ */

/* Su mobile: stemma e pulsante sulla prima riga, navigazione sotto.
   Da 900px: marchio, navigazione a destra, pulsante in coda. */
.nav-login {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  order: 2;
  margin-left: auto;
  padding: .44rem .78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease;
}

.nav-login svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex: none;
}

.nav-login:hover { background: var(--sand); border-color: var(--gold); }

.site-nav { order: 3; }

@media (min-width: 900px) {
  .site-nav { order: 2; }
  .nav-login { order: 3; margin-left: .2rem; }
}

/* ---------- Hero --------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 12% -10%, #1b5ba3 0%, transparent 62%),
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, #10437f 100%);
  color: #eaf1fa;
  padding-block: clamp(2.5rem, 6vw, 4.75rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

@media (min-width: 820px) {
  .hero-inner { grid-template-columns: 300px minmax(0, 1fr); }
}

.hero-logo {
  justify-self: center;
  width: clamp(180px, 40vw, 260px);
  border-radius: 50%;
  background: #fff;
  padding: 10px;
  box-shadow: 0 18px 45px rgba(2, 12, 28, .45), 0 0 0 1px rgba(227, 201, 136, .5);
}

.hero-logo img { border-radius: 50%; }

.hero .kicker {
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 700;
  margin: 0 0 .8rem;
}

.hero h1 {
  color: #fff;
  margin-bottom: .6rem;
}

.hero .lead {
  font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem);
  color: #cddcee;
  max-width: 56ch;
  margin-bottom: 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.hero-rule {
  width: 76px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 3px;
  margin: 0 0 1.4rem;
  border: 0;
}

/* ---------- Pulsanti ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .16s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #25190a;
  box-shadow: 0 10px 24px rgba(193, 154, 69, .32);
}
.btn-gold:hover { color: #1b1206; }

.btn-ghost {
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover { background: var(--navy-soft); color: #fff; }

.btn-outline {
  border-color: var(--navy);
  color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff; }

/* ---------- Sezioni ----------------------------------------------------- */

section { scroll-margin-top: 96px; }

.section { padding-block: clamp(2.5rem, 5vw, 4.25rem); }
.section-sand { background: var(--sand); }
.section-line { border-top: 1px solid var(--line); }

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(1.5rem, 3vw, 2.4rem);
}

.eyebrow {
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 .7rem;
}

.two-col {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 880px) {
  .two-col { grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); }
}

.lead-lg {
  font-size: clamp(1.05rem, .98rem + .45vw, 1.25rem);
  color: #2b3c56;
}

/* ---------- Elenco fatti ------------------------------------------------- */

.facts {
  list-style: none;
  margin: 0;
  padding: 1.35rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.facts li {
  display: grid;
  grid-template-columns: 7.6rem minmax(0, 1fr);
  gap: .3rem 1rem;
  padding-block: .7rem;
  border-bottom: 1px dashed var(--line);
  font-size: .97rem;
}

.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.facts li:first-child { padding-top: 0; }

.facts dt,
.facts .k {
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  padding-top: .22rem;
}

.facts .v { color: var(--ink); }

/* ---------- Schede ------------------------------------------------------ */

.cards {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.4rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
}

a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cfd8e6;
}

.card h3 { margin-bottom: .15rem; }

.card p {
  margin: 0;
  color: var(--muted);
  font-size: .96rem;
}

.card .card-cta {
  margin-top: auto;
  padding-top: .9rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
}

.card-tag {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8a7440;
  background: #fbf5e4;
  border: 1px solid #ecdfba;
  border-radius: 999px;
  padding: .2rem .55rem;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eef3fa;
  color: var(--navy);
  display: grid;
  place-items: center;
  margin-bottom: .35rem;
}

.card-icon svg { width: 22px; height: 22px; }

/* ---------- Banda in evidenza ------------------------------------------- */

.feature {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  background: linear-gradient(155deg, #ffffff 0%, #fbf8f1 100%);
  border: 1px solid #eadfc6;
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 820px) {
  .feature { grid-template-columns: minmax(0, .72fr) minmax(0, 1fr); }
}

.feature-media { justify-self: center; max-width: 320px; width: 100%; }

.feature-media img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid #e7dfcd;
}

.feature h2 { margin-bottom: .6rem; }

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  list-style: none;
  margin: 1rem 0 1.4rem;
  padding: 0;
}

.pill-list li {
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy);
  background: #eef3fa;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  padding: .3rem .75rem;
}

/* ---------- Locandina --------------------------------------------------- */

.poster-layout {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 880px) {
  .poster-layout { grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); }
}

.poster-figure {
  margin: 0;
  position: sticky;
  top: 96px;
}

.poster-figure img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.poster-figure figcaption {
  font-size: .82rem;
  color: var(--muted);
  padding-top: .7rem;
}

.poster-open {
  display: block;
  cursor: zoom-in;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 12px;
}

.poster-open:focus-visible { outline-offset: 4px; }

.info-box {
  background: var(--sand);
  border: 1px solid #e7dfcd;
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-block: 1.5rem;
}

.info-box h3 { margin-top: 0; font-size: 1.1rem; }

.info-box .facts {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.note {
  font-size: .92rem;
  color: var(--muted);
  border-left: 3px solid var(--gold);
  padding-left: .9rem;
  margin: 1.2rem 0 0;
}

/* ---------- Pagine in allestimento -------------------------------------- */

.placeholder {
  min-height: 52vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.placeholder-inner { max-width: 52ch; }

.placeholder .badge {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8a7440;
  background: #fbf5e4;
  border: 1px solid #ecdfba;
  border-radius: 999px;
  padding: .35rem .85rem;
  margin-bottom: 1.2rem;
}

.placeholder p { color: var(--muted); }

.placeholder .hero-actions { justify-content: center; }

.page-head {
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.page-head h1 { color: #fff; margin-bottom: .35rem; }

.page-head p {
  margin: 0;
  color: #c9d8ea;
  max-width: 60ch;
}

.breadcrumb {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0 0 .9rem;
}

.breadcrumb a { color: var(--gold-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Piè di pagina ----------------------------------------------- */

.site-footer {
  background: var(--navy-deep);
  color: #b9c9dd;
  padding-block: clamp(2.25rem, 5vw, 3.25rem) 1.5rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  font-size: .94rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.footer-brand { display: flex; gap: .9rem; align-items: center; }

.footer-brand img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  flex: none;
}

.footer-brand strong {
  display: block;
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}

.footer-brand span { font-size: .86rem; color: #93a9c4; }

.site-footer h4 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0 0 .9rem;
  font-weight: 700;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }

.site-footer a { color: #cfdcec; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.25rem;
  font-size: .82rem;
  color: #8fa5c0;
}

/* ---------- Lightbox ---------------------------------------------------- */

dialog.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 780px);
  max-height: 94vh;
}

dialog.lightbox::backdrop { background: rgba(4, 14, 28, .82); }

dialog.lightbox img {
  max-height: 90vh;
  width: auto;
  margin-inline: auto;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.lightbox-close {
  position: absolute;
  top: -.25rem;
  right: -.25rem;
  transform: translate(50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(9, 30, 60, .9);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* ---------- Utility ----------------------------------------------------- */

.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

@media print {
  .site-header, .site-footer, .hero-actions, .breadcrumb { display: none; }
  .poster-figure { position: static; }
  body { font-size: 11pt; }
}

/* ==========================================================================
   Varianti di layout delle schede (impostabili dall'amministratore)
   ========================================================================== */

.feature.layout-media-right { direction: rtl; }
.feature.layout-media-right > * { direction: ltr; }
.feature.layout-no-media { grid-template-columns: minmax(0, 1fr); }
.feature.layout-no-media .feature-media { display: none; }

@media (min-width: 820px) {
  .feature.layout-media-right { grid-template-columns: minmax(0, 1fr) minmax(0, .72fr); }
}

.cards .card-wrap {
  position: relative;
  display: flex;
}

.cards .card-wrap > .card {
  flex: 1 1 auto;
}

.card-img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: .5rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card.layout-media-left,
.card.layout-media-right {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: .9rem;
  align-items: start;
}

.card.layout-media-right { grid-template-columns: minmax(0, 1fr) 96px; }
.card.layout-media-right .card-img { order: 2; }
.card.layout-media-left .card-img,
.card.layout-media-right .card-img { aspect-ratio: 1 / 1; margin-bottom: 0; }

.placeholder-img {
  border: 1px dashed #cbd5e3;
  border-radius: var(--radius);
  min-height: 180px;
  background: repeating-linear-gradient(45deg, #f4f6fa, #f4f6fa 10px, #eef1f7 10px, #eef1f7 20px);
}

.placeholder-img-real {
  margin: 1.2rem auto 0;
  border-radius: var(--radius);
  max-width: 420px;
}

/* ==========================================================================
   Area amministratore
   ========================================================================== */

.is-admin [data-block],
.is-admin .card-wrap,
.is-admin .page-head,
.is-admin .placeholder {
  position: relative;
}

.pencil {
  display: none;
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  place-items: center;
  box-shadow: 0 6px 18px rgba(7, 38, 74, .35);
  transition: transform .15s ease, background-color .15s ease;
}

.pencil svg { width: 18px; height: 18px; }

.pencil:hover { transform: scale(1.08); background: var(--navy-soft); }

.is-admin .pencil { display: grid; }

.is-admin .hero .pencil,
.is-admin .page-head .pencil {
  border-color: rgba(255, 255, 255, .6);
  background: var(--gold);
  color: #25190a;
}

.is-admin [data-block]:hover,
.is-admin .card-wrap:hover {
  outline: 2px dashed rgba(193, 154, 69, .55);
  outline-offset: 4px;
}

.adminbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  background: rgba(7, 38, 74, .96);
  color: #dce7f5;
  font-size: .82rem;
  box-shadow: 0 14px 34px rgba(4, 14, 28, .4);
  backdrop-filter: blur(6px);
}

.adminbar strong { color: #fff; font-weight: 600; }
.adminbar-sep { opacity: .5; }
.adminbar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
}

.adminbar-btn {
  border: 1px solid rgba(255, 255, 255, .28);
  background: transparent;
  color: #dce7f5;
  border-radius: 999px;
  padding: .3rem .7rem;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.adminbar-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- Modale di modifica ---------- */

body.modal-aperta { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 18, 34, .62);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  padding: 0 1.4rem 1.2rem;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 .8rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.modal-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.modal-close {
  border: 0;
  background: var(--sand);
  color: var(--navy);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-fields { display: grid; gap: 1rem; }

.field { display: grid; gap: .35rem; }

.field-label {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cdd6e3;
  border-radius: 8px;
  padding: .55rem .7rem;
}

.field textarea { resize: vertical; min-height: 68px; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.field-preview {
  max-width: 190px;
  max-height: 150px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: none;
}

.field-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.field-file { font-size: .85rem; }
.field-hint { font-size: .8rem; color: var(--muted); }

.rep-list { display: grid; gap: .45rem; }
.rep-row { display: flex; align-items: center; gap: .35rem; }
.rep-row input, .rep-row select { flex: 1 1 auto; min-width: 0; }
.rep-row.azione input[type="text"] { flex: 1 1 8rem; }
.rep-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem .5rem;
  display: grid;
  gap: .45rem;
  background: #fbfcfe;
}
.rep-card legend { font-size: .78rem; font-weight: 700; color: var(--navy); padding: 0 .3rem; }

.mini-btn {
  border: 1px solid #cdd6e3;
  background: #fff;
  color: var(--navy);
  border-radius: 8px;
  padding: .4rem .6rem;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  flex: none;
}
.mini-btn:hover { background: var(--sand); }
.mini-btn.add { justify-self: start; border-style: dashed; }
.mini-btn.danger { color: #a3242b; border-color: #e6b9bb; }
.mini-btn.danger:hover { background: #fdeced; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding-top: 1.2rem;
  margin-top: .6rem;
  border-top: 1px solid var(--line);
}

.modal-error { color: #a3242b; font-size: .9rem; min-height: 1.2em; margin: .6rem 0 0; }

.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translate(-50%, 12px);
  z-index: 120;
  padding: .6rem 1rem;
  border-radius: 10px;
  background: var(--navy-deep);
  color: #fff;
  font-size: .88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.admin-toast.visibile { opacity: 1; transform: translate(-50%, 0); }
.admin-toast.errore { background: #8d1f26; }

/* ---------- Accesso amministratore ---------- */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 480px at 15% -10%, #1b5ba3 0%, transparent 60%),
    linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 60%, #10437f 100%);
  padding: 1.5rem;
}

.login-wrap { width: min(380px, 100%); }

.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 2rem 1.75rem 1.6rem;
  box-shadow: 0 30px 70px rgba(3, 12, 26, .45);
  display: grid;
  gap: .5rem;
  text-align: center;
}

.login-logo { margin: 0 auto .4rem; border-radius: 50%; }
.login-card h1 { font-size: 1.3rem; margin: 0; }
.login-card > p { margin: 0 0 .6rem; color: var(--muted); font-size: .92rem; }
.login-card label {
  text-align: left;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.login-card input {
  font: inherit;
  padding: .65rem .8rem;
  border: 1px solid #cdd6e3;
  border-radius: 10px;
}
.login-card .btn { justify-content: center; margin-top: .4rem; }
.login-back { font-size: .84rem; color: var(--muted); margin-top: .3rem; }
.login-error { color: #a3242b; font-size: .9rem; margin: 0; }

@media (max-width: 640px) {
  .adminbar { font-size: .76rem; gap: .35rem; bottom: 8px; padding: .45rem .7rem; }
  .adminbar strong { display: none; }
  .adminbar-sep { display: none; }
  .card.layout-media-left,
  .card.layout-media-right { grid-template-columns: 72px minmax(0, 1fr); }
  .card.layout-media-right { grid-template-columns: minmax(0, 1fr) 72px; }
}
