/* ── Design tokens ──────────────────────────────────────────── */
:root {
  /* Fonts */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Manrope', system-ui, -apple-system, sans-serif;

  /* Brand */
  --brand-red:          #F44336;
  --brand-red-dark:     #C62828;
  --brand-red-light:    #FFDAD6;
  --on-brand-red-container: #410002;

  /* Tertiary green */
  --green:            #4F6536;
  --green-container:  #D1EBB0;
  --on-green-container: #0E2000;

  /* Info blue */
  --blue:            #1F6FB2;
  --blue-container:  #D8ECFF;
  --on-blue-container: #0E2A40;

  /* Amber */
  --amber-container:    #FFE7C4;
  --on-amber-container: #3F2700;

  /* Surfaces */
  --bg-page:               #FFF8F7;
  --surface:               #FFFFFF;
  --surface-container-low: #FAF4F2;
  --surface-container:     #F4EDE9;
  --surface-container-high:#EEE7E4;

  /* Text */
  --fg-1: #1C1B1F;
  --fg-2: #49454F;
  --fg-3: #938F96;

  /* Outline */
  --outline:         #CAC4D0;
  --outline-variant: #E7E0EC;

  /* Legacy compat (used by existing pages) */
  --red-400: #ef5350;
  --red-500: #f44336;
  --red-600: #e53935;
  --red-700: #d32f2f;
  --red-800: #c62828;
  --red-900: #b71c1c;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;

  /* Radius */
  --radius-xs:   6px;
  --radius-sm:   10px;
  --radius-md:   16px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.14), 0 8px 24px rgba(0,0,0,0.08);

  --header-height: 64px;
}

/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-page);
  color: var(--fg-1);
  margin: 0;
}

/* ── App shell ──────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,248,247,.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--outline-variant);
  height: var(--header-height);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.header-logo img {
  height: 32px;
  width: auto;
  display: block;
}

.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.header-nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg-2);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-nav-link:hover {
  background: #FFEDEA;
  color: var(--fg-1);
}

.header-nav-link.active {
  background: var(--brand-red-light);
  color: var(--on-brand-red-container);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-red-light);
  color: var(--on-brand-red-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.header-avatar-btn:hover { background: #FFB4AB; }

.btn-header-login {
  padding: 8px 22px;
  border-radius: var(--radius-full);
  background: var(--brand-red);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn-header-login:hover {
  background: var(--brand-red-dark);
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .header-nav { display: none; }
}

/* ── Main content ───────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding-bottom: 32px;
}

/* Bottom nav is always visible on mobile */
@media (max-width: 959px) {
  .app-main { padding-bottom: 96px; }
}

/* ── Bottom nav (logged-in, mobile) ────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--surface-container-high);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  text-decoration: none;
  color: var(--fg-2);
  font-size: 0.6875rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.bottom-nav-item.active { color: var(--on-brand-red-container); }

.bottom-nav-indicator {
  width: 56px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.25s ease;
}

.bottom-nav-item.active .bottom-nav-indicator { background: #FFB4AB; }

@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 32px; }
}

/* ── Hero (photo) ───────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg-photo {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=1200&q=80');
  background-size: cover;
  background-position: center 35%;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20,8,8,0.90) 0%,
    rgba(20,8,8,0.50) 50%,
    rgba(20,8,8,0.18) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 24px 48px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.hero-logo {
  height: 36px;
  width: auto;
  display: block;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.78);
  margin: 0 0 20px;
  line-height: 1.5;
  font-weight: 500;
}

.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Home page content ──────────────────────────────────────── */
.home-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

/* ── Greeting ───────────────────────────────────────────────── */
.greeting-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-red);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.greeting-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0 0 6px;
  line-height: 1.15;
}

.greeting-subtitle {
  font-size: 15px;
  color: var(--fg-2);
  margin: 0;
}

.greeting-login-link {
  color: var(--brand-red);
  font-weight: 700;
  text-decoration: none;
}

.greeting-login-link:hover { text-decoration: underline; }

/* ── Quick actions ──────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 28px 0 36px;
}

.quick-action-card {
  border-radius: 22px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.quick-action-card .qa-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.qa-red   { background: var(--brand-red-light); color: var(--on-brand-red-container); }
.qa-green { background: var(--green-container);  color: var(--on-green-container); }
.qa-blue  { background: var(--blue-container);   color: var(--on-blue-container); }
.qa-warm  { background: var(--surface-container); color: var(--fg-1); }

/* ── Section header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--fg-1);
  margin: 0;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-red);
  text-decoration: none;
}

.section-link:hover { text-decoration: underline; }

/* ── Tomorrow's class row ───────────────────────────────────── */
.class-row {
  background: var(--surface);
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  margin-bottom: 10px;
}

.class-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}

.class-time-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.class-time-hour {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.class-time-min {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}

.class-info { flex: 1; min-width: 0; }

.class-name {
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-1);
  margin-bottom: 3px;
}

.class-meta { font-size: 12px; color: var(--fg-2); }

.class-status {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.class-spots          { font-size: 12px; font-weight: 700; }
.class-spots--full    { color: #BA1A1A; }
.class-spots--few     { color: #B26A00; }
.class-spots--ok      { color: var(--fg-2); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  color: var(--fg-3);
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-2);
  margin: 8px 0 4px;
}

/* ── Guest promo ────────────────────────────────────────────── */
.guest-promo {
  background: var(--brand-red);
  border-radius: 24px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.guest-promo-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  margin: 0 0 4px;
}

.guest-promo-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.guest-promo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-promo-outline {
  padding: 11px 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,0.5);
  background: transparent;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-promo-outline:hover { background: rgba(255,255,255,0.15); }

.btn-promo-filled {
  padding: 11px 24px;
  border-radius: var(--radius-full);
  border: none;
  background: #fff;
  color: var(--brand-red);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

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

/* ── Corsi page ─────────────────────────────────────────────── */
/* Remove all focus outlines — we rely on visual state for interactive elements */
:focus, :focus-visible { outline: none !important; }

.catalog-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.week-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface-container);
  color: var(--fg-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.week-nav-btn:hover:not(:disabled) {
  background: var(--brand-red-light);
  color: var(--brand-red);
  transform: scale(1.08);
}
.week-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}

.catalog-page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0 0 6px;
}

.catalog-page-sub {
  font-size: 16px;
  color: var(--fg-2);
  margin: 0;
}

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar-wrap {
  position: relative;
  margin: 20px 0 0;
}

.search-bar-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-bar {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--surface);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-full);
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-1);
  transition: border-color 0.15s ease;
}

.search-bar:focus { border-color: var(--brand-red); }
.search-bar::placeholder { color: var(--fg-3); }

/* ── Day filter row ─────────────────────────────────────────── */
.day-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  border: 1px solid var(--outline-variant);
}

.filter-btn {
  border-radius: var(--radius-sm) !important;
  text-transform: none !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 6px 18px !important;
  min-height: 36px !important;
  transition: all 0.18s ease !important;
  letter-spacing: 0.2px !important;
}

/* ── Filter chips (native button row) ─────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--outline-variant);
  background: var(--surface);
  color: var(--fg-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
  background: var(--brand-red-light);
}

.filter-chip.selected {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
}

.catalog-results-count {
  font-size: 13px;
  color: var(--fg-3);
  font-weight: 600;
  margin-bottom: 16px;
}

/* ── Booking card (new design) ──────────────────────────────── */
.booking-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--outline-variant);
}

.booking-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.booking-card-header {
  height: 80px;
  position: relative;
  overflow: hidden;
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.booking-card-header .deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.booking-card-header-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.booking-card-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.booking-card-tag--full {
  background: var(--brand-red-light);
  color: var(--on-brand-red-container);
}

.booking-card-tag--few {
  background: var(--amber-container);
  color: var(--on-amber-container);
}

/* Legacy accent bar — hidden in new design */
.booking-card-accent { display: none; }

/* Photo-header variant */
.booking-card-image {
  height: 160px;
  background-color: var(--surface-container);
  background-size: cover;
  background-position: center;
  position: relative;
  flex-shrink: 0;
}

.booking-card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.32) 0%, transparent 60%);
}

.booking-card-image-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.booking-card-image-tag-right {
  position: absolute;
  top: 12px;
  right: 12px;
}

.booking-card-body {
  padding: 16px 20px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.booking-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg-1);
  margin: 0 0 6px;
  line-height: 1.25;
}

.booking-card-body .mud-typography {
  font-family: var(--font-body) !important;
}

.booking-card-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--outline-variant);
}

/* ── Schedule chips ─────────────────────────────────────────── */
.schedule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.schedule-chip {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(244,67,54,0.28);
  color: var(--red-600);
  background: rgba(244,67,54,0.05);
  white-space: nowrap;
}

.schedule-chip--secondary {
  border-color: rgba(30,41,59,0.18);
  color: var(--slate-600);
  background: rgba(30,41,59,0.04);
}

/* ── Session list (CourseDetail) ────────────────────────────── */
.session-day-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
}

.session-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}

.session-day-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--fg-1);
  text-transform: capitalize;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--outline-variant);
  transition: background 0.15s ease;
}

.session-row:last-child { border-bottom: none; }
.session-row:hover { background: var(--surface-container-low); }

.session-time {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--fg-1);
}

/* ── My bookings ────────────────────────────────────────────── */
.bookings-day-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
  transition: opacity 0.2s ease;
}

.bookings-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}

.bookings-day-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--fg-1);
  text-transform: capitalize;
}

.booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--outline-variant);
  transition: background 0.15s ease;
}

.booking-row:last-child { border-bottom: none; }
.booking-row:hover { background: var(--surface-container-low); }

/* ── Course hero ────────────────────────────────────────────── */
.course-hero {
  position: relative;
  height: clamp(220px, 35vw, 360px);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.course-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.72) 100%);
}

.course-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 28px;
  max-width: 1080px;
  margin: 0 auto;
}

.course-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-bottom: auto;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(0,0,0,0.28);
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
  transition: background 0.15s;
}

.course-hero-back:hover { background: rgba(0,0,0,0.45); }

.course-hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  margin-bottom: 10px;
  width: fit-content;
}

.course-hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.course-hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.82);
  margin: 0;
  max-width: 520px;
  line-height: 1.5;
}

/* ── Page header / back nav ─────────────────────────────────── */
.page-back-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 0;
  max-width: 1080px;
  margin: 0 auto 8px;
  flex-wrap: wrap;
}

.page-heading-block {
  padding: 12px 24px 0;
  max-width: 1080px;
  margin: 0 auto 24px;
}

/* ── Booking confirm ────────────────────────────────────────── */
.booking-confirm-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.booking-confirm-header {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  padding: 20px 24px;
  color: white;
}

.booking-confirm-body { padding: 8px 0; }

.booking-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--outline-variant);
}

.booking-detail-row:last-child { border-bottom: none; }

.booking-detail-icon {
  width: 36px;
  height: 36px;
  background: rgba(244,67,54,0.08);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Profile page ───────────────────────────────────────────── */
.profile-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.profile-stat-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 20px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  color: var(--fg-1);
}

.profile-stat-label {
  font-size: 12px;
  color: var(--fg-2);
  font-weight: 600;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-red-light);
  color: var(--on-brand-red-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--fg-1);
  margin: 0 0 4px;
}

.profile-role { font-size: 14px; color: var(--fg-2); margin: 0; }

.profile-menu {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--outline-variant);
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--fg-1);
  border-bottom: 1px solid var(--outline-variant);
  transition: background 0.15s ease;
  font-size: 15px;
  font-weight: 500;
}

.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: var(--surface-container-low); }

.profile-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Auth forms ─────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - var(--header-height) - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--outline-variant);
  padding: 44px 40px;
}

.auth-logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.auth-logo-img { height: 38px; width: auto; }

.auth-logo-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--fg-1);
  line-height: 1.2;
}

.auth-logo-sub {
  font-size: 0.72rem;
  color: var(--fg-3);
  font-weight: 500;
  display: block;
}

.gym-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  color: var(--fg-2);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.4px;
}

.gym-input {
  width: 100%;
  padding: 13px 15px;
  background-color: var(--surface-container-low);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  color: var(--fg-1);
  font-size: 0.95rem;
  font-family: var(--font-body);
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  outline: none;
}

.gym-input:focus {
  background: var(--surface);
  border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(244,67,54,0.10);
}

.gym-input::placeholder { color: var(--fg-3); font-weight: 400; }

/* ── MudDialog overrides ────────────────────────────────────── */

/* ── Shared: dialogs that own their full layout ─────────────── */
.mud-dialog.dialog-self-contained,
.mud-dialog.dialog-booking {
  border-radius: 28px !important;
  overflow: hidden !important;
}
.mud-dialog.dialog-self-contained .mud-dialog-title,
.mud-dialog.dialog-booking       .mud-dialog-title  { display: none !important; }
.mud-dialog.dialog-self-contained .mud-dialog-content,
.mud-dialog.dialog-booking       .mud-dialog-content { padding: 0 !important; }
.mud-dialog.dialog-self-contained .mud-dialog-actions,
.mud-dialog.dialog-booking       .mud-dialog-actions { display: none !important; }

/* Booking dialog: scrollable body, no visible scrollbar, no extra margin */
.mud-dialog.dialog-booking .mud-dialog-content {
  max-height: 82vh !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
  margin: 0 !important;
}
.mud-dialog.dialog-booking .mud-dialog-content::-webkit-scrollbar { display: none; }

/* unused day-picker styles */
.booking-day-btn {
  min-width: 56px;
  padding: 10px 8px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-container);
  color: var(--fg-1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all .2s ease;
  flex-shrink: 0;
  font-family: var(--font-body);
}
.booking-day-btn.selected {
  background: var(--brand-red);
  color: #fff;
  transform: scale(1.06);
}
.booking-day-btn .day-abbr  { font-size: 11px; font-weight: 600; opacity: .8; }
.booking-day-btn .day-num   { font-size: 20px; font-weight: 800; font-family: var(--font-display); }

/* ── Footer ─────────────────────────────────────────────────── */
.gym-footer {
  background: var(--slate-900);
  color: rgba(255,255,255,0.80);
  padding: 60px 0 32px;
}

.gym-footer-brand {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--red-400);
  display: block;
  margin-bottom: 4px;
}

.gym-footer-subbrand {
  font-size: 0.75rem;
  opacity: 0.38;
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
}

.gym-footer-tagline { font-size: 0.85rem; opacity: 0.55; line-height: 1.65; display: block; }

.gym-footer-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.36);
  margin-bottom: 16px;
  display: block;
}

.gym-footer-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.65);
}

.gym-footer-link {
  display: block;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.60) !important;
  margin-bottom: 10px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.gym-footer-link:hover { color: var(--white) !important; }

.gym-footer-copy {
  font-size: 0.74rem;
  opacity: 0.28;
  text-align: center;
  display: block;
}

/* ── MudBlazor overrides ────────────────────────────────────── */
/* Ensure chips inherit font */
.mud-chip-content, .mud-chip { font-family: var(--font-body) !important; }

/* Legacy section utilities */
.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 10px;
  display: block;
}

.section-title {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  margin-bottom: 10px !important;
  color: var(--fg-1) !important;
}

.section-subtitle {
  color: var(--fg-2) !important;
  margin-bottom: 36px !important;
  line-height: 1.6 !important;
}

/* ── Timetable (Orari) ──────────────────────────────────────── */
.timetable-outer {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 16px 12px;
  overflow-x: hidden;
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-sm);
}

.timetable-grid {
  display: grid;
  gap: 6px;
}

.timetable-day-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 8px 4px;
  text-align: center;
  color: var(--fg-1);
}

.timetable-hour {
  font-size: 11px;
  color: var(--fg-3);
  font-weight: 700;
  padding: 16px 6px 0 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.timetable-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timetable-cell-empty {
  height: 70px;
  border-radius: 14px;
  background: var(--surface-container-low);
  opacity: 0.45;
}

.timetable-class {
  min-height: 70px;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.timetable-class.bookable:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.timetable-class-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.timetable-class-spots {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
}

/* Legend */
.timetable-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.timetable-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-3);
  font-weight: 600;
}

.timetable-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .home-content    { padding: 24px 16px 0; }
  .catalog-page    { padding: 24px 16px 0; }
  .page-back-header { padding: 16px 16px 0; }
  .page-heading-block { padding: 12px 16px 0; }
  .profile-page    { padding: 24px 16px 0; }
  .auth-card       { padding: 28px 20px; border-radius: var(--radius-lg); }
  .hero-content    { padding: 28px 16px 36px; }
  .quick-actions   { grid-template-columns: 1fr 1fr; }
  .day-filter      { width: 100%; }

  /* Timetable: compress columns to fit without horizontal scroll */
  .timetable-outer    { padding: 10px 6px; }
  .timetable-day-header { font-size: 11px; padding: 6px 2px; }
  .timetable-hour     { font-size: 10px; padding-right: 4px; }
  .timetable-cell-empty { height: 52px; border-radius: 10px; }
  .timetable-class    { min-height: 52px; padding: 6px 6px; border-radius: 10px; }
  .timetable-class-name  { font-size: 10px; }
  .timetable-class-spots { font-size: 9px; }
}
