@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@700&display=swap');

:root {
  --forest: #17604b;
  --forest-dark: #0b3d31;
  --emerald: #23866b;
  --gold: #e2ad27;
  --gold-soft: #fff3ce;
  --ink: #17201b;
  --muted: #647069;
  --line: #dce2dd;
  --paper: #fff;
  --canvas: #edf1ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 14px;
}

.is-hidden { display: none !important; }

.form-shell {
  width: min(940px, calc(100% - 32px));
  margin: 32px auto 50px;
  overflow: hidden;
  border-radius: 16px;
  background: white;
  box-shadow: 0 18px 55px rgba(27, 52, 38, .12);
}

.form-intro {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 34px;
  color: white;
  background: linear-gradient(120deg, var(--forest-dark), var(--forest));
}
.form-intro img { width: 135px; height: 95px; padding: 7px; object-fit: contain; border-radius: 10px; background: white; }
.form-intro .eyebrow { color: #f5d87f; }
.form-intro h1 { margin: 3px 0 6px; font: 700 31px/1.15 "Playfair Display", Georgia, serif; }
.form-intro p:last-child { max-width: 610px; margin: 0; color: #dce9e1; line-height: 1.5; }

#quotationForm { padding: 28px 34px 32px; }
#quotationForm fieldset { margin: 0 0 26px; padding: 0; border: 0; }
#quotationForm legend { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 14px; color: var(--forest); font: 700 18px/1.2 "Playfair Display", Georgia, serif; }
#quotationForm legend span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--gold); font: 700 9px "DM Sans", Arial, sans-serif; }
.form-grid { display: grid; gap: 14px; }
.form-grid.three-cols { grid-template-columns: repeat(3, 1fr); }
.form-grid.two-cols { grid-template-columns: repeat(2, 1fr); }
.form-grid.four-cols { grid-template-columns: repeat(4, 1fr); }
.form-grid label { display: flex; flex-direction: column; gap: 6px; }
.form-grid label span { color: #536159; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .55px; }
.form-grid input, .form-grid textarea { width: 100%; padding: 10px 11px; border: 1px solid #d6ded9; border-radius: 7px; outline: none; color: var(--ink); background: #fbfcfb; transition: .15s ease; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(36, 79, 57, .1); background: white; }
.form-grid textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.three-cols .wide { grid-column: span 2; }
.four-cols .wide { grid-column: span 4; }
.form-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; border-top: 1px solid var(--line); }
.form-actions p { margin: 0; color: #a43b32; font-size: 12px; }
.form-actions button { display: flex; align-items: center; gap: 10px; margin-left: auto; padding: 12px 20px; border: 0; border-radius: 8px; color: white; background: var(--forest); font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(36,79,57,.2); }
.form-actions button:hover { background: var(--forest-dark); }
.form-actions svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

input, textarea, button { font: inherit; }

.toolbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 920px;
  margin: 18px auto;
  padding: 12px 16px;
  border: 1px solid #d7ddd9;
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 30px rgba(24, 54, 39, .08);
  backdrop-filter: blur(10px);
}

.toolbar div { display: flex; flex-direction: column; gap: 2px; }
.toolbar .toolbar-actions { flex-direction: row; gap: 8px; }
.toolbar span { color: var(--muted); font-size: 12px; }
.toolbar button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--forest);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(36, 79, 57, .2);
}
.toolbar button:hover { background: var(--forest-dark); }
.toolbar .secondary-button { color: var(--forest); background: white; border: 1px solid #cdd7d1; box-shadow: none; }
.toolbar .secondary-button:hover { background: #f1f5f2; }
.toolbar svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.quotation {
  position: relative;
  overflow: hidden;
  width: 210mm;
  height: 297mm;
  margin: 20px auto 50px;
  padding: 13mm 14mm 10mm;
  background: var(--paper);
  box-shadow: 0 18px 55px rgba(27, 52, 38, .13);
}

.quotation::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -48mm;
  right: -35mm;
  width: 92mm;
  height: 92mm;
  border: 15mm solid rgba(226, 173, 39, .08);
  border-radius: 50%;
  pointer-events: none;
}
.quotation::after {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: -32mm;
  left: -36mm;
  width: 80mm;
  height: 80mm;
  border-radius: 50%;
  background: rgba(35, 134, 107, .045);
  pointer-events: none;
}
.quotation > * { position: relative; z-index: 1; }

.brand-header {
  display: grid;
  grid-template-columns: 135px 1fr 150px;
  gap: 22px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--forest), var(--emerald), var(--gold)) 1;
}

.logo { width: 128px; height: 88px; object-fit: contain; mix-blend-mode: multiply; }
.brand-copy { padding-left: 20px; border-left: 1px solid var(--line); }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; font-size: 10px; }
.brand-copy h1 { margin: 0; color: var(--forest); font: 700 28px/1.1 "Playfair Display", Georgia, serif; }
.brand-copy > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.quote-meta { display: grid; gap: 4px; align-self: center; padding: 9px 11px; border: 1px solid #dbe5df; border-radius: 8px; background: #f7faf8; }
.quote-meta label { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.quote-meta input { width: 100%; padding: 3px 0 5px; border: 0; border-bottom: 1px solid var(--line); outline: none; color: var(--ink); font-weight: 600; font-size: 11px; }

.welcome { position: relative; overflow: hidden; margin: 14px 0; padding: 13px 18px; border-radius: 9px; color: white; background: linear-gradient(120deg, var(--forest-dark), var(--forest) 68%, var(--emerald)); box-shadow: 0 7px 18px rgba(11,61,49,.13); }
.welcome::after { content: ""; position: absolute; right: -24px; top: -52px; width: 125px; height: 125px; border: 18px solid rgba(255,255,255,.07); border-radius: 50%; }
.welcome > * { position: relative; z-index: 1; }
.welcome-label { margin: 0 0 3px; color: #f5d87f; text-transform: uppercase; letter-spacing: 1.7px; font-size: 9px; font-weight: 700; }
.welcome h2 { margin: 0; font: 700 19px/1.25 "Playfair Display", Georgia, serif; }
.welcome h2 input { width: 75%; border: 0; outline: 0; color: inherit; background: transparent; font: inherit; text-transform: capitalize; }
.welcome > p:last-child { margin: 5px 0 0; color: #dce9e1; font-size: 10px; }

.section-block { margin-top: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 7px; }
.section-heading > div { display: flex; align-items: center; gap: 8px; }
.section-heading span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: white; background: var(--gold); font-size: 9px; font-weight: 700; }
.section-heading h3 { margin: 0; color: var(--forest); font: 700 17px/1.2 "Playfair Display", Georgia, serif; }
.section-heading h3 b { font: inherit; }
.section-heading > p { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 700; letter-spacing: .5px; }
.section-heading > p input { width: 115px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; text-transform: uppercase; }
.compact { margin-bottom: 6px; }

.details-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #d5e1da; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 13px rgba(24,79,59,.045); }
.details-grid label { min-height: 61px; padding: 10px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(145deg, #fff, #f8fbf9); }
.details-grid label:nth-child(4n) { border-right: 0; }
.details-grid label:nth-child(n+5) { border-bottom: 0; }
.details-grid label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.details-grid input { width: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 700; }

.tariff-table { overflow: hidden; border: 1px solid #d5e1da; border-radius: 8px; box-shadow: 0 5px 15px rgba(24,79,59,.05); }
.table-row { display: grid; grid-template-columns: 1.1fr 1.5fr 1fr; }
.table-row > div { display: flex; align-items: center; min-height: 32px; padding: 6px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; }
.table-row > div:last-child { justify-content: flex-end; border-right: 0; font-weight: 700; }
.table-row:last-child > div { border-bottom: 0; }
.table-head { color: var(--forest-dark); background: linear-gradient(90deg, #fff1c1, #fff8e6); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.table-head > div { min-height: 28px; font-size: 8px; }
.tariff-table input { width: 56px; padding: 1px 3px; border: 0; border-bottom: 1px dotted #9ba59f; outline: 0; background: transparent; font-size: 10px; font-weight: 700; text-align: center; }
.tariff-table .small-input { width: 34px; }
.money-prefix { width: auto; height: auto; margin-right: 1px; color: inherit; background: none; font-size: inherit; }
.total-row { color: white; background: linear-gradient(100deg, var(--forest-dark), var(--forest) 65%, var(--emerald)); }
.total-row > div { min-height: 42px; border-color: rgba(255,255,255,.16); }
.total-row > div:first-child { font: 700 14px/1.1 "Playfair Display", Georgia, serif; }
.total-row > div:nth-child(2) { color: #d7e4dc; font-size: 9px; }
.total-row > div:last-child { color: #ffe18d; font-size: 16px; }

.bottom-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 11px; margin-top: 14px; }
.inclusions, .notes { min-height: 132px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; }
.inclusions { border-color: #eadba7; background: linear-gradient(135deg, #fff7dc, #fff 72%); box-shadow: 0 5px 15px rgba(90,74,24,.05); }
.notes { border-color: #d5e1da; background: linear-gradient(145deg, #f7fbf9, #fff); box-shadow: 0 5px 15px rgba(24,79,59,.04); }
.mini-heading { display: flex; align-items: center; gap: 8px; }
.mini-heading h3, .notes h3 { margin: 0 0 7px; color: var(--forest); font: 700 14px/1.2 "Playfair Display", Georgia, serif; }
.gift { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: white; background: var(--gold); }
.inclusions ul { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 15px; margin: 4px 0 0; padding: 0; list-style: none; }
.inclusions li { position: relative; padding-left: 13px; color: #44524a; font-size: 8.5px; }
.inclusions li::before { content: "✓"; position: absolute; left: 0; color: var(--forest); font-weight: 700; }
.notes textarea { width: 100%; resize: none; padding: 0; border: 0; outline: 0; color: #56615b; background: transparent; font-size: 9px; line-height: 1.55; }

footer { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
footer > div:first-child { display: flex; flex-direction: column; }
footer strong { color: var(--forest); font-size: 9px; }
footer p { margin: 0; text-align: center; font-style: italic; }
.signature { justify-self: end; width: 115px; padding-top: 17px; border-top: 1px solid #aab2ad; text-align: center; }

.print-tip { position: fixed; right: 20px; bottom: 20px; padding: 10px 14px; border-radius: 8px; opacity: 0; transform: translateY(10px); pointer-events: none; color: white; background: #18271f; font-size: 12px; transition: .25s ease; }
.print-tip.show { opacity: 1; transform: translateY(0); }

@media (max-width: 850px) {
  .form-shell { width: 100%; margin: 0; border-radius: 0; }
  .form-intro { grid-template-columns: 90px 1fr; padding: 22px 18px; }
  .form-intro img { width: 88px; height: 70px; }
  .form-intro h1 { font-size: 24px; }
  #quotationForm { padding: 24px 18px; }
  .form-grid.two-cols, .form-grid.three-cols, .form-grid.four-cols { grid-template-columns: repeat(2, 1fr); }
  .three-cols .wide, .four-cols .wide { grid-column: span 2; }
  .toolbar { margin: 0; border-radius: 0; }
  .toolbar span { display: none; }
  .quotation { width: 100%; min-height: 0; margin: 0; padding: 24px 18px; }
  .brand-header { grid-template-columns: 90px 1fr; }
  .logo { width: 85px; height: 65px; }
  .brand-copy { padding-left: 10px; }
  .brand-copy h1 { font-size: 22px; }
  .quote-meta { grid-column: 1 / -1; grid-template-columns: auto 1fr auto 1fr; align-items: center; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .details-grid label:nth-child(2n) { border-right: 0; }
  .details-grid label:nth-child(n+5) { border-bottom: 1px solid var(--line); }
  .details-grid label:nth-child(n+7) { border-bottom: 0; }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .form-intro { grid-template-columns: 1fr; }
  .form-intro img { display: none; }
  .form-grid.two-cols, .form-grid.three-cols, .form-grid.four-cols { grid-template-columns: 1fr; }
  .three-cols .wide, .four-cols .wide { grid-column: span 1; }
  .toolbar > div:first-child { display: none; }
  .toolbar { justify-content: flex-end; }
}

@page { size: A4 portrait; margin: 0; }

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: white; }
  .toolbar, .print-tip, .form-shell { display: none !important; }
  .quotation { display: block !important; }
  html, body { width: 210mm; height: 297mm; overflow: hidden; }
  .quotation { width: 210mm; height: 297mm; min-height: 297mm; max-height: 297mm; margin: 0; padding: 12mm 14mm 9mm; box-shadow: none; page-break-after: avoid; break-after: avoid-page; }
  input, textarea { color: inherit !important; }
  input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="time"]::-webkit-calendar-picker-indicator,
  input[type="number"]::-webkit-inner-spin-button { display: none; appearance: none; }
}
