/* ============================================
   Dental Forms — Clean, framework-free CSS
   Warm palette + brand color from config
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --peach-light: #fff5f2; --gold-light: #fef9ee;
  --sage-light: #f4f6f3;  --mist-light: #f3f5f7; --slate-light: #f1f3f5;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f9f9f8; color: #1e293b; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--brand); padding: 12px 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.header-row { display: flex; align-items: center; justify-content: space-between; }
.logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-link img { border-radius: 4px; }
.header-name { color: #fff; font-weight: 600; font-size: .95rem; }
.header-phone { color: rgba(255,255,255,.85); font-size: .85rem; text-decoration: none; }
.header-phone:hover { color: #fff; }

.page-title { text-align: center; font-size: 1.35rem; font-weight: 700; color: #2d3748; margin: 28px 0 20px; }

/* Sections */
.section { background: #fff; border: 1px solid #e8e8e4; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.section.tint-peach { background: var(--peach-light); border-color: #f5ddd6; }
.section.tint-gold  { background: var(--gold-light);  border-color: #f0e4c8; }
.section.tint-sage  { background: var(--sage-light);  border-color: #dde2da; }
.section.tint-mist  { background: var(--mist-light);  border-color: #d8dde2; }
.section.tint-slate { background: var(--slate-light);  border-color: #d5d9de; }

/* Section title — plain underlined text, NOT a button */
.section-title {
  color: var(--brand); font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--brand);
}

/* Grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Fields */
.field { display: flex; flex-direction: column; }
.field label { font-size: .8rem; font-weight: 600; color: #475569; margin-bottom: 4px; }
.req { color: #dc2626; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="date"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: .9rem; font-family: inherit; color: #1e293b; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.field textarea { resize: vertical; min-height: 60px; }

/* Radio */
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.radio-group label { display: flex; align-items: center; gap: 5px; font-size: .85rem; font-weight: 400; cursor: pointer; }
.radio-group input[type="radio"] { accent-color: var(--brand); }

/* Yes/No rows */
.yn-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.yn-row:last-child { border-bottom: none; }
.yn-label { font-size: .85rem; color: #334155; }
.yn-opts { display: flex; gap: 10px; }
.yn-opts label { font-size: .8rem; display: flex; align-items: center; gap: 3px; cursor: pointer; }

/* Checkbox */
.check-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 6px 0; cursor: pointer; }
.check-row input { accent-color: var(--brand); }

/* Info box */
.info-box {
  background: #fafaf8; border: 1px solid #e8e8e4; border-radius: 10px;
  padding: 18px; font-size: .84rem; color: #475569; line-height: 1.75; margin-bottom: 16px;
}
.info-box strong { color: #1e293b; }
.info-box p { margin-bottom: 8px; }
.info-box p:last-child { margin-bottom: 0; }

/* Signature section */
.sig-section { background: #fff; border: 2px solid var(--brand); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.sig-wrap { border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; background: #fff; touch-action: none; }
.sig-wrap canvas { display: block; width: 100%; height: 120px; }
.sig-error { color: #dc2626; font-size: .8rem; display: none; margin-top: 4px; }
.sig-error.show { display: block; }
.date-display { padding: 9px 11px; background: #f8f8f6; border: 1px solid #e2e2de; border-radius: 8px; font-size: .9rem; color: #475569; }

/* Buttons */
.btn-submit {
  display: block; width: 100%; padding: 14px; margin-top: 20px;
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: opacity .15s, transform .1s;
}
.btn-submit:hover { opacity: .9; transform: translateY(-1px); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-small { margin-top: 6px; padding: 4px 14px; font-size: .78rem; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; color: #475569; }
.btn-small:hover { background: #f5f5f3; }
.btn-action { display: inline-block; padding: 6px 16px; font-size: .82rem; font-weight: 600; background: var(--brand); color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.btn-action:hover { opacity: .9; }
.btn-danger { background: #dc2626; color: #fff; }

/* Form menu (warm palette) */
.form-menu { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.form-menu a {
  display: block; text-align: center; padding: 14px 20px; border-radius: 10px;
  font-size: 1rem; font-weight: 600; color: #fff; text-decoration: none;
  transition: opacity .15s, transform .1s; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.form-menu a:hover { opacity: .9; transform: translateY(-1px); }
.form-menu a small { font-weight: 400; opacity: .85; }
.form-menu .f-peach { background: #e8907a; }
.form-menu .f-gold  { background: #d9a340; }
.form-menu .f-sage  { background: #768a6e; }
.form-menu .f-slate { background: #7a8794; }

/* Messages */
.msg-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 20px; border-radius: 10px; text-align: center; font-weight: 600; font-size: 1.05rem; display: none; }
.msg-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 12px; border-radius: 8px; font-size: .85rem; display: none; }

/* Loading */
.loading { position: fixed; inset: 0; background: rgba(255,255,255,.9); display: none; align-items: center; justify-content: center; flex-direction: column; z-index: 999; }
.loading.show { display: flex; }
.spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top-color: var(--brand); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin-top: 12px; font-weight: 600; color: #475569; }

/* Footer */
.site-footer { text-align: center; padding: 20px 0; margin-top: 24px; border-top: 1px solid #e8e8e4; color: #94a3b8; font-size: .78rem; }

/* Responsive */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .header-name { font-size: .82rem; }
  .section { padding: 14px; }
  .sig-wrap canvas { height: 100px; }
}
