:root {
  --blue: #2c4786;
  --dark: #1a2a50;
  --primary: #087f7a;
  --primary-dark: #06635f;
  --red: #c74632;
  --red-dark: #a93627;
  --bg: #f0f3f8;
  --card-bg: #ffffff;
  --text: #1e293b;
  --muted: #5f6d80;
  --border: #e2e8f0;
  --green: #257a4f;
  --yellow: #a97808;
  --nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito Sans", Arial, sans-serif;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  overscroll-behavior-y: contain;
}

button, input { font: inherit; }

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(10, 20, 50, 0.97);
}

.install-box {
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.install-header {
  padding: 28px 24px 24px;
  background: linear-gradient(135deg, var(--dark), var(--blue));
  color: #fff;
  text-align: center;
}

.install-logo {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.install-welcome {
  font-family: Nunito, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
}

.install-sub {
  color: rgba(255,255,255,0.86);
  font-size: 0.92rem;
}

.install-body { padding: 24px; }

.install-intro {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff8f0, #fff0ee);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  color: var(--dark);
}

.platform-tab { display: flex; gap: 8px; margin-bottom: 18px; }

.platform-btn {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-family: Nunito, sans-serif;
  font-weight: 800;
}

.platform-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.install-steps { display: grid; gap: 12px; }

.install-step {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
}

.step-num {
  flex: 0 0 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
}

.step-text { padding-top: 3px; font-size: 0.92rem; }

.install-cta,
.notif-btn,
.btn-reset,
.remove-all {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  font-family: Nunito, sans-serif;
  font-weight: 900;
}

.install-cta {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.install-cta.secondary { background: #e8eef7; color: var(--dark); }

.install-progress {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  background: #eef8f7;
  text-align: center;
}

.install-progress > i { color: var(--primary); font-size: 2rem; }
.install-progress > strong { font: 900 1.1rem Nunito, sans-serif; }
.install-progress p { margin: 0; color: var(--muted); }
.install-progress-track { height: 7px; overflow: hidden; border-radius: 9px; background: #cad9e4; }
.install-progress-track span { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--primary); animation: install-loading 1.3s ease-in-out infinite; }
.install-check { justify-self: center; border: 0; background: transparent; color: var(--primary-dark); font-weight: 900; text-decoration: underline; }
@keyframes install-loading { from { transform: translateX(-105%); } to { transform: translateX(240%); } }

.install-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  background: var(--dark);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 4px 20px rgba(26,42,80,0.35);
}

.header-image-wrap { position: relative; }

.header-img {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 108px 10px 14px;
  background:
    linear-gradient(90deg, rgba(26,42,80,0.98), rgba(44,71,134,0.88)),
    var(--dark);
  color: #fff;
}

.header-img img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.header-img strong,
.header-img span {
  display: block;
}

.header-img strong {
  font-family: Nunito, sans-serif;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.1;
}

.header-img span {
  color: rgba(255,255,255,0.82);
  font-size: 0.78rem;
}

.header-btns {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: linear-gradient(to left, rgba(26,42,80,0.92), transparent);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

.search-bar {
  position: sticky;
  top: 74px;
  z-index: 40;
  padding: 8px 12px 10px;
  background: rgba(240, 243, 248, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.prog-subnav {
  display: flex;
  gap: 5px;
  padding-bottom: 7px;
}

.prog-subnav-btn {
  flex: 1;
  padding: 7px 4px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-family: Nunito, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.prog-subnav-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.search-row i { color: var(--muted); }
.search-row input { width: 100%; border: 0; outline: none; color: var(--text); }

.room-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 8px;
}

.room-pills button {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.room-pills button.active {
  background: var(--dark);
  color: #fff;
}

.app-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 12px 22px;
}

.section-title {
  margin: 6px 0 16px;
  color: var(--dark);
  font-family: Nunito, sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
}

.info-card,
.event-card,
.download-card,
.map-card,
.map-list-item,
.empty-state {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
}

.info-card { margin-bottom: 10px; overflow: hidden; }

.info-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 0;
  background: #fff;
  color: var(--text);
}

.info-card-header-left { display: flex; align-items: center; gap: 12px; }

.info-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #e8eefc;
  color: var(--primary);
  border-radius: 10px;
}

.info-card-title {
  color: var(--dark);
  font-family: Nunito, sans-serif;
  font-weight: 900;
}

.info-card-body {
  padding: 0 16px 16px 62px;
  color: var(--muted);
  font-size: 0.94rem;
}

.info-card-body strong { display: block; margin-top: 10px; color: var(--dark); }

.day-block { margin-bottom: 13px; }

.day-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--dark);
  color: #fff;
  font-family: Nunito, sans-serif;
  font-weight: 900;
}

.event-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr 38px;
  gap: 10px;
  margin-top: 10px;
  padding: 13px;
}

.event-card.compact {
  grid-template-columns: 58px 1fr 38px;
}

.event-time {
  color: var(--primary-dark);
  font-family: Nunito, sans-serif;
  font-weight: 900;
  line-height: 1.1;
}

.event-time span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.event-room {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.room-verde { color: var(--green); }
.room-gialla { color: var(--yellow); }
.room-rossa { color: var(--red); }

.event-content h2 {
  margin: 0 0 5px;
  color: var(--dark);
  font-family: Nunito, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.event-content p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.event-speaker {
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.fav-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
}

.fav-btn.active {
  background: #fee2e2;
  color: var(--red);
}

.faculty-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
}

.faculty-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
}

.faculty-item strong,
.faculty-item span {
  display: block;
}

.faculty-item span { color: var(--muted); font-size: 0.86rem; }

.download-card,
.empty-state {
  padding: 28px 18px;
  text-align: center;
}

.download-card i,
.empty-state i {
  display: block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 2.7rem;
}

.btn-reset {
  background: var(--primary);
  color: #fff;
}

.notif-banner {
  margin-bottom: 14px;
  padding: 14px;
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
}

.notif-banner.active {
  background: linear-gradient(135deg, #eafbea, #d4f5d4);
  border-color: #86d986;
}

.notif-banner h5 {
  margin: 0 0 6px;
  color: #7c2d12;
  font-family: Nunito, sans-serif;
  font-weight: 900;
}

.notif-banner.active h5 { color: #1a6b1a; }
.notif-banner p { margin-bottom: 12px; color: #7c2d12; font-size: 0.86rem; }

.notif-btn {
  background: var(--red);
  color: #fff;
}

.notif-btn:disabled {
  background: #cbd5e1;
  color: #64748b;
}

.remove-all {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #fecaca;
  color: var(--red-dark);
}

.floor-plan {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 220px;
  padding: 14px;
}

.hall {
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-family: Nunito, sans-serif;
  font-weight: 900;
}

.hall.verde { background: var(--green); }
.hall.gialla { background: var(--yellow); }
.hall.rossa { background: var(--red); }
.hall.foyer { grid-column: 1 / -1; background: var(--dark); }

.partner-title {
  margin: 18px 0 8px;
  color: var(--dark);
  font-family: Nunito, sans-serif;
  font-weight: 900;
}

.map-list-item {
  margin-bottom: 8px;
  padding: 12px 14px;
}

.map-list-item strong,
.map-list-item span {
  display: block;
}

.map-list-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: var(--nav-h);
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

.nav-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: Nunito, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
}

.nav-tab i {
  display: block;
  margin-bottom: 1px;
  font-size: 1.45rem;
}

.nav-tab.active { color: var(--primary); }

.nav-tab span {
  position: absolute;
  top: 7px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 0.6rem;
}

:focus-visible {
  outline: 3px solid #5eead4;
  outline-offset: 2px;
}

@media (min-width: 780px) {
  .app-main { padding-top: 22px; }
  .event-card { grid-template-columns: 76px 1fr 44px; }
}
