/* ==========================================================================
   Catania Powerlifting – tema
   Base: Bootstrap 5.3, personalizzato tramite le sue variabili CSS.
   Palette: antracite + rosso (i colori rossazzurri di Catania), accento blu.
   ========================================================================== */

:root {
  --cp-red: #e10600;
  --cp-red-dark: #b40500;
  --cp-red-rgb: 225, 6, 0;
  --cp-blue: #0b4ea2;
  --cp-ink: #0f1115;
  --cp-ink-2: #1a1d23;
  --cp-ink-3: #262a32;
  --cp-bg: #f3f4f6;
  --cp-muted: #6b7280;
  --cp-radius: 1rem;
  --cp-shadow: 0 1px 2px rgba(15, 17, 21, .06), 0 8px 24px rgba(15, 17, 21, .06);
  --cp-shadow-lg: 0 20px 40px rgba(15, 17, 21, .14);
  --cp-bottom-nav-h: 64px;

  --bs-font-sans-serif: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: #1f2328;
  --bs-primary: var(--cp-red);
  --bs-primary-rgb: var(--cp-red-rgb);
  --bs-link-color: var(--cp-red);
  --bs-link-color-rgb: var(--cp-red-rgb);
  --bs-link-hover-color: var(--cp-red-dark);
  --bs-link-hover-color-rgb: 180, 5, 0;
  --bs-border-radius: .75rem;
  --bs-border-radius-sm: .5rem;
  --bs-border-radius-lg: 1rem;
  --bs-border-color: #e5e7eb;
  --bs-focus-ring-color: rgba(var(--cp-red-rgb), .25);
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  /* Solo la pagina è grigia: card, modali e campi restano bianchi (usano --bs-body-bg). */
  background-color: var(--cp-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }

h1, h2, h3, .h1, .h2, .h3 { font-weight: 800; letter-spacing: -.02em; }
.h4, .h5, .h6, h4, h5, h6 { font-weight: 700; }

/* Titoli "da palestra": maiuscolo, condensato visivamente */
.cp-display {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .95;
}
.cp-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cp-red);
}
.text-accent { color: var(--cp-red) !important; }

/* --------------------------------------------------------------------------
   Pulsanti
   -------------------------------------------------------------------------- */
.btn { font-weight: 600; border-radius: .75rem; padding: .6rem 1.1rem; }
.btn-sm { border-radius: .55rem; padding: .35rem .7rem; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; border-radius: .9rem; }

.btn-primary {
  --bs-btn-bg: var(--cp-red);
  --bs-btn-border-color: var(--cp-red);
  --bs-btn-hover-bg: var(--cp-red-dark);
  --bs-btn-hover-border-color: var(--cp-red-dark);
  --bs-btn-active-bg: var(--cp-red-dark);
  --bs-btn-active-border-color: var(--cp-red-dark);
  --bs-btn-disabled-bg: #f19c99;
  --bs-btn-disabled-border-color: #f19c99;
  --bs-btn-focus-shadow-rgb: var(--cp-red-rgb);
  box-shadow: 0 6px 16px rgba(var(--cp-red-rgb), .25);
}
.btn-primary:disabled, .btn-primary.disabled { box-shadow: none; }

.btn-outline-primary {
  --bs-btn-color: var(--cp-red);
  --bs-btn-border-color: rgba(var(--cp-red-rgb), .35);
  --bs-btn-hover-bg: var(--cp-red);
  --bs-btn-hover-border-color: var(--cp-red);
  --bs-btn-active-bg: var(--cp-red-dark);
  --bs-btn-active-border-color: var(--cp-red-dark);
  --bs-btn-focus-shadow-rgb: var(--cp-red-rgb);
}

.btn-dark {
  --bs-btn-bg: var(--cp-ink);
  --bs-btn-border-color: var(--cp-ink);
  --bs-btn-hover-bg: var(--cp-ink-3);
  --bs-btn-hover-border-color: var(--cp-ink-3);
}

.btn-ghost-light {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .06);
}
.btn-ghost-light:hover { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); }

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .25rem rgba(var(--cp-red-rgb), .2);
  border-color: rgba(var(--cp-red-rgb), .55);
}
.form-check-input:checked { background-color: var(--cp-red); border-color: var(--cp-red); }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.form-control, .form-select { border-radius: .7rem; padding: .65rem .9rem; border-color: #d9dce1; }
.form-control-sm, .form-select-sm { padding: .35rem .65rem; border-radius: .55rem; }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }

/* --------------------------------------------------------------------------
   Card, superfici, tabelle
   -------------------------------------------------------------------------- */
.card {
  --bs-card-border-color: transparent;
  --bs-card-border-radius: var(--cp-radius);
  --bs-card-inner-border-radius: var(--cp-radius);
  --bs-card-cap-bg: transparent;
  box-shadow: var(--cp-shadow);
}
.card-header { font-weight: 700; border-bottom: 1px solid var(--bs-border-color); padding: 1rem 1.25rem; }
.card-body { padding: 1.25rem; }
@media (min-width: 768px) { .card-body { padding: 1.5rem; } }

.surface {
  background: #fff;
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  padding: 1rem;
}
@media (min-width: 768px) { .surface { padding: 1.5rem; } }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .75rem; }
.table thead th {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--cp-muted); font-weight: 700; border-bottom-width: 1px;
}
.table-surface { background: #fff; border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); overflow: hidden; }
.table-surface .table > :not(caption) > * > * { padding-left: 1rem; padding-right: 1rem; }

.list-group { --bs-list-group-border-color: var(--bs-border-color); --bs-list-group-border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); }
.list-group-item { padding: .9rem 1.1rem; }

.badge { font-weight: 600; padding: .4em .65em; border-radius: .5rem; }

.alert { border: 0; border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); }
.alert-success { background: #e8f7ee; color: #0f5132; }
.alert-danger { background: #fdecec; color: #8a1c1c; }
.alert-warning { background: #fff6e0; color: #6b4b00; }

.page-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }

/* Indicatori numerici (dashboard) */
.stat { background: #fff; border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); padding: 1.1rem 1.25rem; height: 100%; }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--cp-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin-top: .25rem; }
.stat-value small { font-size: .9rem; font-weight: 500; color: var(--cp-muted); }

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.cp-navbar {
  background: rgba(15, 17, 21, .92);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.cp-navbar .navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; font-size: 1rem; line-height: 1; }
.cp-navbar .navbar-brand small { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .22em; color: var(--cp-red); margin-top: .2rem; }
.cp-logo { width: 34px; height: 34px; flex: none; }
.cp-navbar .nav-link { color: rgba(255, 255, 255, .72); font-weight: 600; border-radius: .6rem; padding: .5rem .8rem !important; }
.cp-navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.cp-navbar .nav-link.active { color: #fff; background: rgba(var(--cp-red-rgb), .9); }
.cp-navbar .navbar-toggler { border: 0; padding: .4rem; }
.cp-navbar .navbar-toggler:focus { box-shadow: none; }
@media (max-width: 767.98px) {
  .cp-navbar .navbar-collapse { padding: .75rem 0 1rem; }
  .cp-navbar .nav-link { padding: .75rem 1rem !important; }
}
.cp-user-chip {
  display: inline-flex; align-items: center; gap: .5rem; color: rgba(255,255,255,.85);
  font-weight: 600; font-size: .9rem; text-decoration: none; padding: .35rem .6rem; border-radius: .6rem;
}
.cp-user-chip:hover { color: #fff; background: rgba(255,255,255,.06); }
.cp-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cp-red); color: #fff; font-weight: 800; font-size: .8rem; text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Barra di navigazione in basso (area cliente su mobile)
   -------------------------------------------------------------------------- */
.cp-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  height: calc(var(--cp-bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(15, 17, 21, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
}
.cp-bottom-nav form { flex: 1; display: flex; }
.cp-bottom-nav a, .cp-bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  color: rgba(255,255,255,.6); text-decoration: none; font-size: .7rem; font-weight: 600;
  background: none; border: 0; padding: 0;
}
.cp-bottom-nav a svg, .cp-bottom-nav button svg { width: 22px; height: 22px; }
.cp-bottom-nav a.active { color: #fff; }
.cp-bottom-nav a.active svg { color: var(--cp-red); }
.cp-bottom-nav a.cp-fab {
  flex: 0 0 auto; width: 58px; height: 58px; margin: -18px .5rem 0; border-radius: 50%;
  background: var(--cp-red); color: #fff; box-shadow: 0 8px 20px rgba(var(--cp-red-rgb), .45);
  border: 4px solid var(--cp-bg);
}
.cp-bottom-nav a.cp-fab svg { width: 26px; height: 26px; color: #fff; }
body.has-bottom-nav main { padding-bottom: calc(var(--cp-bottom-nav-h) + 1.5rem + env(safe-area-inset-bottom)); }
body.has-bottom-nav .footer { display: none; }
@media (min-width: 768px) {
  .cp-bottom-nav { display: none; }
  body.has-bottom-nav main { padding-bottom: 2rem; }
  body.has-bottom-nav .footer { display: block; }
}

/* --------------------------------------------------------------------------
   Hero (home pubblica)
   -------------------------------------------------------------------------- */
.cp-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(var(--cp-red-rgb), .55), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(11, 78, 162, .45), transparent 60%),
    linear-gradient(160deg, #15171c 0%, #0b0c0f 100%);
  padding: 4.5rem 0 5rem;
  margin-top: -1.5rem;
}
.cp-hero::after {
  /* Trama a diagonali leggera */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: repeating-linear-gradient(135deg, #fff 0 1px, transparent 1px 14px);
}
.cp-hero .container { position: relative; z-index: 1; }
.cp-hero h1 { font-size: clamp(2.6rem, 9vw, 5.5rem); }
.cp-hero .lead { color: rgba(255,255,255,.78); max-width: 34rem; font-size: 1.15rem; }
.cp-hero-plates { position: absolute; right: -60px; bottom: -40px; width: 420px; opacity: .12; z-index: 0; }
@media (max-width: 767.98px) {
  .cp-hero { padding: 3rem 0 3.5rem; }
  .cp-hero-plates { width: 260px; right: -70px; bottom: -50px; }
}
.cp-hero-facts { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 2.5rem; }
.cp-hero-facts div { font-size: .85rem; color: rgba(255,255,255,.65); }
.cp-hero-facts strong { display: block; font-size: 1.6rem; color: #fff; font-weight: 800; line-height: 1.1; }

.section { padding: 3.5rem 0; }
@media (max-width: 767.98px) { .section { padding: 2.5rem 0; } }
.section-title { font-size: clamp(1.6rem, 4vw, 2.3rem); }

/* Card pacchetto */
.cp-plan {
  position: relative; background: #fff; border-radius: 1.25rem; box-shadow: var(--cp-shadow);
  padding: 1.75rem; height: 100%; display: flex; flex-direction: column;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.cp-plan:hover { transform: translateY(-3px); box-shadow: var(--cp-shadow-lg); }
.cp-plan.featured { background: var(--cp-ink); color: #fff; border-color: var(--cp-red); }
.cp-plan .cp-plan-entries { font-size: 3.2rem; font-weight: 900; line-height: 1; }
.cp-plan .cp-plan-entries span { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-left: .35rem; }
.cp-plan .cp-plan-price { font-size: 1.9rem; font-weight: 800; margin-top: 1rem; }
.cp-plan .cp-plan-unit { font-size: .9rem; color: var(--cp-muted); }
.cp-plan.featured .cp-plan-unit { color: rgba(255,255,255,.65); }
.cp-plan ul { list-style: none; padding: 0; margin: 1.25rem 0 0; font-size: .95rem; }
.cp-plan li { display: flex; gap: .5rem; align-items: flex-start; padding: .25rem 0; }
.cp-plan li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: .15rem; border-radius: 50%;
  background: rgba(var(--cp-red-rgb), .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23e10600'%3E%3Cpath d='M6.4 11.2 3.2 8l1.1-1.1 2.1 2.1 5.3-5.3L12.8 4.8z'/%3E%3C/svg%3E") center/12px no-repeat; }
.cp-plan-badge {
  position: absolute; top: -12px; right: 1.25rem; background: var(--cp-red); color: #fff;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: .35rem .7rem; border-radius: 999px;
}

/* Orari */
.cp-hours { display: grid; gap: .5rem; }
.cp-hours-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: .9rem; padding: .9rem 1.1rem; box-shadow: var(--cp-shadow); font-weight: 600; }
.cp-hours-row .closed { color: var(--cp-muted); font-weight: 500; }

/* --------------------------------------------------------------------------
   Prenotazione: giorni e slot
   -------------------------------------------------------------------------- */
.cp-days {
  display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: .25rem .1rem .75rem; margin: 0 -.1rem 1rem; scrollbar-width: thin;
}
.cp-day {
  flex: 0 0 auto; scroll-snap-align: start; width: 64px; padding: .6rem 0; text-align: center;
  background: #fff; border-radius: .9rem; box-shadow: var(--cp-shadow); text-decoration: none; color: inherit;
  border: 2px solid transparent;
}
.cp-day .dow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--cp-muted); }
.cp-day .num { font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.cp-day .mon { font-size: .7rem; color: var(--cp-muted); text-transform: uppercase; }
.cp-day:hover { border-color: rgba(var(--cp-red-rgb), .3); color: inherit; }
.cp-day.active { background: var(--cp-ink); color: #fff; }
.cp-day.active .dow, .cp-day.active .mon { color: rgba(255,255,255,.7); }
.cp-day.has-mine { position: relative; }
.cp-day.has-mine::after { content: ""; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--cp-red); }

.cp-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
@media (max-width: 575.98px) { .cp-slots { grid-template-columns: repeat(2, 1fr); } }
.cp-slot {
  width: 100%; border: 2px solid transparent; background: #fff; border-radius: .9rem; padding: .85rem .5rem;
  text-align: center; box-shadow: var(--cp-shadow); display: block; color: inherit; text-decoration: none;
  transition: transform .1s ease, border-color .1s ease;
}
.cp-slot .time { font-size: 1.15rem; font-weight: 800; }
.cp-slot .state { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: .1rem; }
.cp-slot.free .state { color: #15803d; }
.cp-slot.free:not(:disabled):hover { border-color: var(--cp-red); transform: translateY(-1px); }
.cp-slot.free:disabled { opacity: .55; }
.cp-slot.mine { background: var(--cp-red); color: #fff; box-shadow: 0 8px 18px rgba(var(--cp-red-rgb), .3); }
.cp-slot.mine .state { color: rgba(255,255,255,.85); }
.cp-slot.taken, .cp-slot.unavailable { background: #eceef1; box-shadow: none; color: #9aa0a8; }
.cp-slot.unavailable { background: repeating-linear-gradient(135deg, #eceef1 0 8px, #e4e6ea 8px 16px); }

/* Card ingressi del cliente */
.cp-entries-card {
  color: #fff; border-radius: 1.25rem; padding: 1.5rem; position: relative; overflow: hidden;
  background: radial-gradient(500px 200px at 100% 0%, rgba(var(--cp-red-rgb), .6), transparent 60%), linear-gradient(150deg, #1d2027, #0d0e11);
  box-shadow: var(--cp-shadow-lg);
}
.cp-entries-card .big { font-size: 4rem; font-weight: 900; line-height: 1; }
.cp-entries-card .muted { color: rgba(255,255,255,.65); }
.cp-progress { height: 8px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.cp-progress > div { height: 100%; background: var(--cp-red); border-radius: 99px; }

.cp-session {
  display: flex; align-items: center; gap: 1rem; background: #fff; border-radius: 1rem; padding: .85rem 1rem; box-shadow: var(--cp-shadow);
}
.cp-session + .cp-session { margin-top: .6rem; }
.cp-date-tile {
  flex: none; width: 54px; text-align: center; border-radius: .8rem; padding: .4rem 0; background: rgba(var(--cp-red-rgb), .08); color: var(--cp-red);
}
.cp-date-tile .d { font-size: 1.35rem; font-weight: 900; line-height: 1; }
.cp-date-tile .m { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cp-session .info { flex: 1; min-width: 0; }
.cp-session .info .t { font-weight: 700; }
.cp-session .info .s { font-size: .85rem; color: var(--cp-muted); }

/* --------------------------------------------------------------------------
   Pagine di accesso
   -------------------------------------------------------------------------- */
.cp-auth { max-width: 440px; margin: 1rem auto 2rem; }
.cp-auth .card-body { padding: 2rem; }
@media (max-width: 575.98px) { .cp-auth .card-body { padding: 1.5rem; } }

/* --------------------------------------------------------------------------
   Backoffice
   -------------------------------------------------------------------------- */
.agenda-table tr.is-blocked { background: repeating-linear-gradient(135deg, #f1f2f4 0 10px, #e9ebee 10px 20px); color: #4b5563; }
.agenda-row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.agenda-row-actions form { display: flex; gap: .4rem; }
@media (max-width: 767.98px) {
  /* L'agenda diventa una lista di card su mobile */
  .agenda-table thead { display: none; }
  .agenda-table, .agenda-table tbody, .agenda-table tr, .agenda-table td { display: block; width: 100%; }
  .agenda-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
  .agenda-table td { padding: .15rem 0 !important; border: 0; }
  .agenda-table td:first-child { font-weight: 800; font-size: 1.05rem; }
  .agenda-row-actions { margin-top: .5rem; }
  .agenda-row-actions form:first-child { flex: 1 1 100%; }
  .agenda-row-actions select { flex: 1; }
}

/* Footer */
.footer { background: var(--cp-ink); color: rgba(255,255,255,.6); padding: 1.5rem 0; font-size: .875rem; margin-top: 2rem; }
.footer a { color: rgba(255,255,255,.85); }

/* Modale di conferma */
.modal-content { border: 0; border-radius: 1.25rem; box-shadow: var(--cp-shadow-lg); }
.modal-body { padding: 1.5rem 1.5rem .5rem; font-weight: 600; }
.modal-footer { border-top: 0; padding: 1rem 1.5rem 1.5rem; }
@media (max-width: 575.98px) {
  .modal-dialog-centered { align-items: flex-end; min-height: calc(100% - 1rem); }
  .modal-footer .btn { flex: 1; }
}

/* Schede (account) */
.nav-pills { --bs-nav-pills-link-active-bg: var(--cp-ink); --bs-nav-link-color: #374151; --bs-nav-link-hover-color: var(--cp-red); gap: .25rem; }
.nav-pills .nav-link { font-weight: 600; border-radius: .65rem; }

/* Il riepilogo errori resta nascosto finché non ci sono errori */
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }

/* Campo esca anti-bot: fuori dallo schermo, non display:none (alcuni bot lo riconoscono) */
.cp-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Utilità */
/* Solo la prima lettera maiuscola ("Lunedì 23 novembre"): in italiano i mesi restano minuscoli. */
.text-capitalize-first::first-letter, .cp-session .info .s::first-letter { text-transform: uppercase; }
span.text-capitalize-first, strong.text-capitalize-first, a.text-capitalize-first { display: inline-block; }
.min-w-0 { min-width: 0; }
