* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #f3f5f9;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 14px 30px;
}

h1 {
  margin: 8px 0 14px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card {
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
  margin-bottom: 14px;
  overflow: hidden; /* fixes “input extends past background” issues on iOS */
}

label {
  display: block;
  font-weight: 800;
  margin: 12px 0 8px;
  font-size: 18px;
}

input, select, textarea, button { font: inherit; }

/* Prevent iOS zoom on focus */
input, select, textarea { font-size: 16px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d6d9e3;
  background: #fff;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
  margin-bottom: 12px; /* adds space above Next: Services button */
}

input::placeholder, textarea::placeholder { color: #9aa4b2; }

input:focus, select:focus, textarea:focus {
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

button, .btn {
  width: 100%;
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 14px 14px;
  background: #1b5cff;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

button.secondary, .btn.secondary {
  background: #eef2ff;
  color: #1b2a52;
  border: 1px solid #d8def3;
}

.muted { color: #667085; font-size: 14px; }

.small { font-size: 13px; color: #6b7280; }

.hr { height: 1px; background: #eef0f5; margin: 14px 0; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 220px; }

/* =========================
   Services page visuals
   ========================= */

.section-title {
  font-weight: 900;
  font-size: 22px;
  margin: 0 0 10px;
}

.svc {
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}

.svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.svc-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.svc-left input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
}

.svc-left label {
  display: inline;
  margin: 0;
  font-weight: 900;
}

.reveal-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f7f9fd;
  border: 1px solid #e6e8ee;
}

/* Tighter nested UI (prevents “nesting doll” look) */
.subcard {
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
  background: #fff;
}

.subcard .muted { margin-top: 2px; }

.option-list {
  margin-top: 10px;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #eef0f5;
}

.option-row:first-child { border-top: none; }

.option-row input[type="radio"],
.option-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
}

.option-row label {
  display: inline;
  margin: 0;
  font-weight: 900;
}

/* Collapsible header row */
.collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

.collapse-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  width: auto;
}

.chev {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid #e6e8ee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-weight: 900;
}

.price-row { margin-top: 10px; }

.total-box {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border: 1px dashed #d6d9e3;
  border-radius: 12px;
  margin-top: 14px;
  font-weight: 900;
}

/* Date overlay (prevents iOS date input weird sizing + keeps inside card) */
.date-overlay { position: relative; }

.date-display {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d6d9e3;
  background: #fff;
  pointer-events: none;
}

.date-display.placeholder { color: #9aa4b2; }

.date-overlay input[type="date"]{
  position: absolute;
  inset: 0;
  opacity: 0; /* still clickable, but we see the display box */
}

/* =========================
   Signature area (sign page)
   ========================= */

.sig-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.sig-actions > * { flex: 1; }

.sig-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  border: 1px solid #d6d9e3;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  touch-action: none; /* important for mobile drawing */
}

#sigCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sig-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  z-index: 2;
}

/* =========================
   Terms modal (fixed overlay)
   ========================= */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal.show {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 92vw);
  max-height: 86vh;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e6e8ee;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

.modal-header,
.modal-footer {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header { border-bottom: 1px solid #eef0f5; }
.modal-footer { border-top: 1px solid #eef0f5; flex-wrap: wrap; }

.modal-close {
  width: auto;
  padding: 10px 12px;
}

/* iOS Safari: iframe inside flex needs an explicit height */
.modal-body {
  position: relative;
  height: 55vh;        /* forces visible scrolling area */
  min-height: 240px;
  overflow: hidden;    /* iframe will scroll, not the modal */
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.modal-open { overflow: hidden; }

/* Admin gear shortcut */
.gear-link{position:fixed;top:14px;right:14px;z-index:1000;text-decoration:none;font-size:20px;line-height:1;background:#fff;border:1px solid #e7e9f0;border-radius:10px;padding:10px 12px;box-shadow:0 6px 18px rgba(16,24,40,.06);} 


/* --- Admin/Login UI upgrades --- */
.headerbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:12px;
}
.header-title{
  font-size:28px; font-weight:900; margin:6px 0;
}
.header-meta{
  color:#667085; font-size:13px; margin-top:4px;
}
.icon-btn{
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  border:1px solid #d6d9e3; border-radius:12px; background:#fff; text-decoration:none;
}
.tabs{
  display:flex; gap:10px; margin:12px 0;
}
.tabbtn{
  flex:1;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #d6d9e3;
  background:#fff;
  font-weight:900;
  text-align:center;
  text-decoration:none;
  color:#111827;
}
.tabbtn.active{
  background:#111827;
  color:#fff;
  border-color:#111827;
}
.login-card{
  max-width:520px;
  margin:40px auto 0;
}
.small-muted{
  color:#667085;
  font-size:13px;
}

.pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:#f3f4f6;
  font-weight:900;
  font-size:12px;
}
