:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-sub: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-focus: #f59e0b;
  --gold-primary: #d97706;
  --gold-dark: #b45309;
  --gold-light: #f59e0b;
  --gold-glow: rgba(217, 119, 6, 0.15);
  --gold-soft-bg: rgba(245, 158, 11, 0.08);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;
  --danger: #dc2626;
  --success: #059669;
  --header-bg: #0b1120;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle warm background accent */
.page-ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 400px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, rgba(248, 250, 252, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Header (Dark premium bar to make the white logo shine) */
.site-header {
  background: var(--header-bg);
  border-bottom: 2px solid #d97706;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.btn-top-db {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-top-db:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
}

/* Intro Card (Light Theme) */
.intro-card {
  margin: 28px 0 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.main-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 12px;
}

.intro-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.instructions-box {
  background: #fefce8;
  border-left: 4px solid var(--gold-primary);
  border: 1px solid #fef08a;
  border-left-width: 4px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: #78350f;
}

.instructions-box strong {
  color: #451a03;
}

/* Form Sections */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.form-section:hover {
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.section-num {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 800;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #fffbeb;
  color: var(--gold-dark);
  border: 1px solid #fde68a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-heading h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.section-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-subtext strong {
  color: #0f172a;
}

/* Form Fields */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.req {
  color: var(--danger);
}

.optional-tag {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-sub);
}

.field-group input[type="text"],
.field-group input[type="date"],
.field-group textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: #0f172a;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.field-group textarea {
  resize: vertical;
}

.val-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.has-val-error input,
.has-val-error textarea {
  border-color: var(--danger) !important;
  background: #fef2f2 !important;
}

.has-val-error .val-error {
  display: block;
}

/* Checkbox Grid */
.sub-block {
  margin-top: 24px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
}

.sub-block-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: block;
  margin-bottom: 12px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.custom-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid #94a3b8;
  background: #ffffff;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.custom-check input[type="checkbox"]:checked ~ .check-box {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
}

.custom-check input[type="checkbox"]:checked ~ .check-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.check-label {
  font-size: 0.9rem;
  color: #334155;
  font-weight: 500;
}

.custom-check:hover .check-label {
  color: #0f172a;
}

.other-service-input {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.other-service-input label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.other-service-input input {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: #0f172a;
  font-size: 0.9rem;
}

/* Tables in Light Theme */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  vertical-align: middle;
  border-bottom: 2px solid #cbd5e1;
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

tbody tr:hover {
  background: #f1f5f9;
}

.col-aspect {
  text-align: left;
  width: 45%;
}

.aspect-title {
  text-align: left;
  font-weight: 600;
  color: #1e293b;
}

.scale-lbl {
  font-size: 0.72rem;
  font-weight: 500;
  color: #64748b;
}

/* Radio buttons inside tables */
td input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  vertical-align: middle;
}

td input[type="radio"]:hover {
  border-color: var(--gold-primary);
  transform: scale(1.15);
}

td input[type="radio"]:checked {
  border-color: var(--gold-primary);
  background: radial-gradient(circle, var(--gold-primary) 45%, #ffffff 50%);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.yn-col {
  width: 15%;
}

/* Prompt Containers */
.prompt-container {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.prompt-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: block;
  margin-bottom: 12px;
}

.radio-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-radio {
  cursor: pointer;
  position: relative;
}

.pill-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-radio span {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pill-radio:hover span {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.pill-radio input[type="radio"]:checked + span {
  background: #fffbeb;
  border-color: var(--gold-primary);
  color: var(--gold-dark);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
}

/* NPS Scale */
.scale-guidance {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
}

.nps-item {
  cursor: pointer;
  position: relative;
  text-align: center;
}

.nps-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nps-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: #334155;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nps-item:hover span {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-2px);
}

.nps-item input[type="radio"]:checked + span {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

.nps-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: 8px;
}

/* Signature Pad in Light Theme */
.signature-wrapper {
  position: relative;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  overflow: hidden;
}

#sign_canvas {
  width: 100%;
  height: 120px;
  display: block;
  cursor: crosshair;
  background: #fafafa;
}

.btn-clear-sign {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-sign:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.closing-thanks {
  color: #78350f;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  padding: 14px;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius-md);
}

/* Submit Button */
.form-action-wrap {
  margin-top: 26px;
  text-align: center;
}

.btn-primary-submit {
  width: 100%;
  max-width: 520px;
  padding: 16px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
}

/* Office Use Only */
.office-use-section {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.office-summary {
  cursor: pointer;
  font-weight: 700;
  color: #475569;
  user-select: none;
  padding: 4px 0;
}

.office-summary:hover {
  color: #0f172a;
}

.office-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.office-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.85rem;
}

.office-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Success Card */
.success-card-dialog {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.success-box {
  background: #ffffff;
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 540px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.success-check-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #ecfdf5;
  border: 2px solid var(--success);
  color: var(--success);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.2);
}

.success-box h2 {
  font-size: 1.6rem;
  color: #0f172a;
  margin-bottom: 8px;
}

.success-box p {
  color: #475569;
  font-size: 0.95rem;
}

.receipt-summary {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
  text-align: left;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.receipt-summary strong {
  color: var(--gold-dark);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn-gold {
  background: var(--gold-primary);
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-gold:hover {
  background: var(--gold-dark);
}

.btn-outline {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Database Modal in Light Theme */
.db-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.db-modal-content {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.db-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.db-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-gold {
  color: var(--gold-primary);
  font-size: 1.5rem;
}

.db-title-area h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.db-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: #0f172a;
}

.db-modal-toolbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
}

.search-wrap input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: #0f172a;
  font-size: 0.88rem;
}

.toolbar-btns {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-danger {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.db-table-scroll {
  padding: 20px 24px;
  overflow: auto;
  flex: 1;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.db-table th, .db-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.db-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  text-align: left;
}

.db-table td {
  text-align: left;
  color: #334155;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 22px 0;
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-brand strong {
  color: #0f172a;
}

.f-sub {
  font-size: 0.78rem;
  margin-top: 2px;
  color: #64748b;
}

.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.dot-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 6px #059669;
}

/* Utilities */
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }

/* Responsive */
@media (max-width: 768px) {
  .details-grid,
  .grid-2col,
  .office-grid {
    grid-template-columns: 1fr;
  }
  .main-title {
    font-size: 1.6rem;
  }
  .form-section {
    padding: 20px 16px;
  }
  .nps-scale {
    grid-template-columns: repeat(6, 1fr);
  }
  .nps-item:last-child {
    grid-column: span 1;
  }
  .table-responsive {
    font-size: 0.82rem;
  }
  th, td {
    padding: 8px 10px;
  }
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .page-ambient-glow,
  .btn-top-db,
  .form-action-wrap,
  .btn-clear-sign,
  .site-footer {
    display: none !important;
  }
  .site-header {
    background: #ffffff !important;
    border-bottom: 2px solid #000000 !important;
    color: #000000 !important;
  }
  .form-section,
  .intro-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
  }
  th {
    background: #f0f0f0 !important;
    color: #000000 !important;
  }
}
