:root {
  --brand: #06699C;
  --brand-dark: #054E77;
  --brand-light: #E8F3F9;
  --text: #1B2733;
  --muted: #6B7A87;
  --bg: #F5F7F9;
  --white: #ffffff;
  --danger: #D64545;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button { font-family: inherit; cursor: pointer; }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--brand);
  color: var(--white);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.header-call {
  text-decoration: none;
  font-size: 18px;
  background: rgba(255,255,255,0.15);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Install banner */
.install-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--brand-dark);
  color: var(--white);
  font-size: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.install-banner.hidden { display: none; }
.install-banner-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: none; border: none; color: var(--white); font-size: 15px; padding: 4px 6px;
}

/* Main / screens */
#app {
  padding-bottom: calc(78px + var(--safe-bottom));
  min-height: 100vh;
}
.screen { display: none; }
.screen.active { display: block; }

.screen-header {
  padding: 18px 16px 4px;
}
.screen-header h2 { margin: 0 0 4px; font-size: 20px; }
.screen-sub { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--white);
  padding: 28px 20px 26px;
  border-radius: 0 0 22px 22px;
}
.hero h1 { font-size: 22px; line-height: 1.3; margin: 0 0 12px; font-weight: 800; }
.rating-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.hero-sub { font-size: 13.5px; opacity: 0.9; margin: 0 0 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  border: none;
  text-decoration: none;
  transition: transform 0.05s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--white); color: var(--brand-dark); }
.btn-outline { background: rgba(255,255,255,0.12); color: var(--white); border: 1.5px solid rgba(255,255,255,0.55); }
.section .btn-outline, .card .btn-outline { background: transparent; color: var(--brand-dark); border: 1.5px solid var(--brand); }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn-white { background: var(--white); color: var(--brand-dark); }

/* Sections */
.section { padding: 22px 16px 4px; }
.section-title { font-size: 16.5px; margin: 0 0 12px; font-weight: 800; }

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.service-card {
  background: var(--white);
  border: 1px solid #E7EBEE;
  border-radius: 14px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  box-shadow: 0 1px 2px rgba(20,30,40,0.04);
}
.service-icon { font-size: 26px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.testimonial-card {
  background: var(--white);
  border: 1px solid #E7EBEE;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}
.testimonial-card .stars { color: #F5B301; font-size: 14px; margin-bottom: 6px; }
.testimonial-card p { font-size: 13.5px; line-height: 1.5; margin: 0 0 8px; color: var(--text); }
.testimonial-author { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.gift-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
  margin: 22px 16px;
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid #E7EBEE;
}
.gift-card-cta h3 { margin: 0 0 4px; font-size: 15px; }
.gift-card-cta p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Cards (Account tab) */
.card {
  background: var(--white);
  border: 1px solid #E7EBEE;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card p { margin: 0 0 10px; font-size: 13.5px; }
.card a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.muted { color: var(--muted); }
.fine-print { font-size: 11.5px; color: var(--muted); margin-top: 8px !important; }

.app-version {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  padding: 18px 0 8px;
}

/* Iframe screens (Book / Appointments) */
.iframe-wrap {
  position: relative;
  height: calc(100vh - 130px - var(--safe-top) - var(--safe-bottom));
  margin: 6px 0 0;
  background: var(--white);
}
.iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.iframe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 13.5px;
  z-index: 1;
}
.iframe-loading.hidden { display: none; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid #E1E8ED;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  background: var(--white);
  border-top: 1px solid #E7EBEE;
  padding: 8px 4px calc(8px + var(--safe-bottom));
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
}
.nav-item.active { color: var(--brand-dark); }
.nav-icon { font-size: 19px; }

@media (min-width: 640px) {
  body { display: flex; justify-content: center; background: #DCE3E8; }
  html { background: #DCE3E8; }
  #app, .app-header, .bottom-nav, .install-banner { max-width: 480px; }
  body::before { content: none; }
  .app-header, #app, .bottom-nav, .install-banner {
    margin: 0 auto;
  }
  body {
    flex-direction: column;
  }
}
