/* Express Bus  home app (standalone, no mobile-exp.css) */

.app-home {
  --ah-primary: #1e40af;
  --ah-primary-dark: #1e3a8a;
  --ah-secondary: #3b82f6;
  --ah-accent: #d8315b;
  --ah-bg: #f1f5f9;
  --ah-surface: #ffffff;
  --ah-text: #0f172a;
  --ah-muted: #64748b;
  --ah-border: #e2e8f0;
  --ah-radius: 16px;
  --ah-radius-sm: 12px;
  --ah-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --ah-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --ah-pad: 16px;
  --ah-font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.app-home,
.app-home * {
  box-sizing: border-box;
}

.app-home {
  margin: 0;
  font-family: var(--ah-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ah-text);
  background: var(--ah-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-home img,
.app-home svg {
  display: block;
}

/* ?? Hero + prenotazione ?? */

.ah-hero {
  position: relative;
  padding: 0 0 8px;
  overflow: hidden;
}

.ah-hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background-color: var(--ah-primary-dark);
  background-image:
    linear-gradient(160deg, rgba(15, 23, 42, 0.55) 0%, rgba(30, 64, 175, 0.45) 45%, rgba(241, 245, 249, 0.15) 100%),
    url('/magelys-express-sfondo.jpg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  border-radius: 0 0 24px 24px;
}

.ah-hero__top {
  position: relative;
  z-index: 1;
  padding: 18px var(--ah-pad) 88px;
  text-align: center;
  color: #fff;
}

.ah-hero__tagline {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.92;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.ah-booking {
  position: relative;
  z-index: 2;
  margin: -72px var(--ah-pad) 0;
  background: var(--ah-surface);
  border-radius: var(--ah-radius);
  box-shadow: var(--ah-shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.ah-booking__head {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--ah-primary) 0%, var(--ah-secondary) 100%);
  color: #fff;
}

.ah-booking__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ah-booking__body {
  padding: 8px;
  background: #f8fafc;
}

.ah-booking__frame {
  display: block;
  width: 100%;
  min-height: 440px;
  border: 0;
  border-radius: var(--ah-radius-sm);
  background: #fff;
}

/* ?? Layout pagina ?? */

.ah-page {
  padding: 12px var(--ah-pad) 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ah-section {
  background: var(--ah-surface);
  border-radius: var(--ah-radius);
  box-shadow: var(--ah-shadow);
  overflow: hidden;
  border: 1px solid var(--ah-border);
}

.ah-section__head {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--ah-primary) 0%, var(--ah-secondary) 100%);
  color: #fff;
}

.ah-section__head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ah-section__body {
  padding: 14px;
}

/* ?? Servizi (2 tile) ?? */

.ah-services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ah-addhome {
  margin: 10px var(--ah-pad) 0;
  position: relative;
  z-index: 3;
}

.ah-addhome__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  color: #1e40af;
  font-weight: 900;
}

.ah-addhome__btn:active {
  transform: scale(0.99);
  background: #eff6ff;
}

@media (min-width: 400px) {
  .ah-services {
    grid-template-columns: 1fr 1fr;
  }
}

.ah-service {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--ah-radius-sm);
  background: #f8fafc;
  border: 1px solid var(--ah-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ah-service:active {
  transform: scale(0.98);
}

.ah-service__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eff6ff;
  margin-bottom: 10px;
}

.ah-service__icon svg {
  width: 28px;
  height: 28px;
}

.ah-service h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ah-primary);
  line-height: 1.25;
}

.ah-service p {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--ah-muted);
  line-height: 1.4;
  flex: 1;
}

.ah-btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ah-primary);
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}

.ah-btn:hover {
  background: var(--ah-secondary);
}

.ah-btn--full {
  display: block;
  width: 100%;
  text-align: center;
}

.ah-service__badge {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px dashed #fbbf24;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

/* ?? Avvisi ?? */

.ah-notices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ah-notice {
  padding: 14px;
  border-radius: var(--ah-radius-sm);
  border: 1px solid transparent;
}

.ah-notice--blue {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
  border-color: #bfdbfe;
}

.ah-notice--green {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border-color: #bbf7d0;
}

.ah-notice__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ah-notice__emoji {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.ah-notice__title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ah-text);
  margin-bottom: 4px;
}

.ah-notice__text {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.5;
}

.ah-notice__text strong {
  color: var(--ah-primary);
}

.ah-notice--green .ah-notice__text strong {
  color: #166534;
}

.ah-btn--blue {
  background: #1d4ed8;
}

.ah-btn--blue:hover {
  background: #1e40af;
}

.ah-btn--green {
  background: #16a34a;
}

.ah-btn--green:hover {
  background: #15803d;
}

/* ?? Linee bus ?? */

.ah-lines {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ah-line {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ah-border);
}

.ah-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ah-line__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ah-line__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ah-primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.ah-line__head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ah-primary);
  line-height: 1.3;
}

.ah-route {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius-sm);
  padding: 12px 12px 12px 8px;
  margin-bottom: 10px;
}

.ah-route::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--ah-secondary);
  border-radius: 1px;
}

.ah-stop {
  position: relative;
  padding: 4px 0 4px 36px;
  font-size: 0.82rem;
  color: #334155;
}

.ah-stop::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ah-secondary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ah-secondary);
}

.ah-stop:first-child::before,
.ah-stop:last-child::before {
  background: var(--ah-accent);
  box-shadow: 0 0 0 1px var(--ah-accent);
}

.ah-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ah-accent);
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.ah-pdf:hover {
  background: #b91c4a;
}

.ah-pdf:active {
  transform: scale(0.97);
}

/* ?? Embed nella mini-app ?? */

html.app-embed .app-home {
  background: var(--ah-bg);
}

html.app-embed .ah-page {
  padding-bottom: 8px;
}
