/* book.css — mobile-first: base styles target a phone screen; the single
   @media (min-width: 700px) block near the bottom widens things for tablet/
   desktop. Almost all your customers will never see that block. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2430;
  background: #f4f5f7;
}
button, input { font-family: inherit; font-size: 16px; } /* 16px prevents iOS auto-zoom on focus */

.hidden { display: none !important; }
.wide-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
.wide-btn.primary { background: #4f7cff; color: white; }
.wide-btn.primary.confirmed { background: #2eaa5a; }
.wide-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wide-btn.confirmed:disabled { opacity: 1; } /* stays fully green even while disabled */
.link-btn {
  background: none;
  border: none;
  color: #4f7cff;
  font-size: 15px;
  padding: 6px 0;
  cursor: pointer;
}

/* ---------------- Login screen ---------------- */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-card h1 { font-size: 22px; margin: 0 0 6px; }
.login-sub { color: #6b7280; font-size: 14px; margin: 0 0 20px; }
.login-card label { display: block; font-size: 13px; color: #555; margin: 14px 0 4px; }
.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d7dae1;
  border-radius: 8px;
}
.login-card button { margin-top: 20px; }
.form-error {
  color: #c0392b;
  background: #fdecea;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  margin-top: 12px;
}

/* ---------------- App shell ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: #1f2430;
  color: white;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar strong { font-size: 14px; }
.seat-limit-info { display: block; font-size: 12px; color: #b7bcc7; margin-top: 2px; }
.topbar .link-btn { color: white; text-decoration: underline; }

.screen-inner { padding: 16px; padding-bottom: 20px; }
.screen-title { font-size: 18px; margin: 4px 0 6px; }
.hint-text { color: #6b7280; font-size: 14px; margin: 0 0 14px; }

/* "Back to sections" stays visible while scrolling the seat picker, right
   below the topbar — negative margins bleed it to the screen-inner's edges
   so the sticky bar spans full width instead of just the padded content area. */
.sub-nav {
  position: sticky;
  top: 56px;
  z-index: 15;
  background: #f4f5f7;
  margin: -16px -16px 12px -16px;
  padding: 8px 16px;
  border-bottom: 1px solid #e1e3e8;
}
.back-link {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  padding: 8px 0;
}

/* ---------------- Canvas / map ---------------- */
.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 14px;
}
/* Overview always shrinks to fit the screen width. */
#overviewCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  touch-action: manipulation;
}
/* The zoomed seat map keeps its natural size: when it's wider than the
   screen (big sections like "Meio") it overflows and .canvas-wrap scrolls
   sideways, so seats never get shrunk below a tappable size. margin:auto
   centres it when it does fit. */
#mapCanvas {
  display: block;
  margin: 0 auto;
  touch-action: pan-x pan-y;
}
#seatScreen .canvas-wrap { max-height: 62vh; }
#mapCanvas.clickable { cursor: pointer; }
.map-message { padding: 40px 16px; text-align: center; color: #9098a8; }

/* ---------------- Legend (BELOW the map, per request) ---------------- */
.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #444;
  margin-bottom: 4px;
}
.legend .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.15);
}
.legend .dot.available { background: rgba(46, 170, 90, 0.7); }
.legend .dot.selected { background: rgba(0, 87, 255, 0.92); }
.legend .dot.booked { background: rgba(183, 188, 199, 0.6); }

/* ---------------- Zone list (tap targets, mobile-friendly) ---------------- */
.zone-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.zone-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: white;
  border: 1px solid #e1e3e8;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.zone-btn .zone-avail {
  font-weight: 400;
  font-size: 13px;
  color: #2eaa5a;
}
.zone-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.zone-btn:disabled .zone-avail { color: #9098a8; }

/* ---------------- Cart + booking form ----------------
   Shared across both the section picker and seat picker screens (it's a
   sibling of both in index.html, not nested inside either), so it's always
   present at the bottom of whichever screen is showing. */
.cart {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin: 0 16px 24px;
}
.cart h3 { margin: 0 0 10px; font-size: 15px; }
.cart-list { list-style: none; margin: 0 0 14px; padding: 0; }
.cart-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eceef2;
  font-size: 14px;
}
.cart-empty { color: #9098a8; border-bottom: none !important; }
.cart-list button {
  border: none;
  background: none;
  color: #e05b5b;
  font-size: 13px;
  cursor: pointer;
}
.booking-form label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
.booking-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d7dae1;
  border-radius: 8px;
  margin-bottom: 12px;
}
.confirmed-message {
  color: #1f7a3d;
  background: #eefaf0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

/* ---------------- "Your booked seats" box ---------------- */
.my-bookings {
  background: white;
  border-radius: 10px;
  padding: 16px;
  margin: 0 16px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.my-bookings .screen-title { margin-top: 0; }
.my-bookings .cart-list li { justify-content: flex-start; gap: 8px; }
.my-bookings .cart-list li .booked-tick { color: #2eaa5a; }

/* ---------------- Toast (pop-up, center of screen) ----------------
   Used for anything the customer needs to notice immediately regardless of
   scroll position — e.g. hitting their seat limit — in addition to the
   inline error message that still appears in the cart. */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  background: #1f2430;
  color: white;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 200;
  cursor: pointer;
}

/* ---------------- Success modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: 12px;
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
}
.modal h3 { margin-top: 0; }
.modal-actions { margin-top: 18px; }

/* ================= Tablet / desktop ================= */
@media (min-width: 700px) {
  .screen-inner { max-width: 900px; margin: 0 auto; padding: 24px; }
  .sub-nav { margin: -24px -24px 12px -24px; padding: 8px 24px; }
  #seatScreen.screen-inner {
    display: grid;
    grid-template-columns: 1fr;
  }
  .cart { max-width: 900px; margin: 0 auto 24px; }
  .my-bookings { max-width: 900px; margin: 0 auto 24px; }
  .zone-list { grid-template-columns: repeat(2, 1fr); }
}
