/* receipt-generator styles */

:root {
  color-scheme: light;
  --bg: #f6fbf8;
  --bg-soft: #eef7f2;
  --panel: #ffffff;
  --text: #0b1a30;
  --muted: #607089;
  --line: rgba(11, 26, 48, 0.1);
  --brand: #00d084;
  --brand-bright: #00b874;
  --accent-soft: rgba(0, 208, 132, 0.08);
  --shadow: 0 24px 56px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --paper: #ffffff;
  --paper-ink: #10203a;
  --paper-muted: #5d6d85;
  --paper-line: #dce5f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(0, 208, 132, 0.12), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(0, 208, 132, 0.08), transparent 20%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 0 56px;
}

.card,
.cta {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(0, 208, 132, 0.08);
  filter: blur(80px);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 9px 14px;
  border: 1px solid rgba(0, 208, 132, 0.16);
  border-radius: 999px;
  background: rgba(0, 208, 132, 0.08);
  color: #0f7a57;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2rem, 4.9vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-point {
  padding: 9px 13px;
  border: 1px solid rgba(11, 26, 48, 0.08);
  border-radius: 999px;
  background: #f7fbf9;
  color: #27415e;
  font-size: 0.88rem;
}

.hero-point-highlight {
  border-color: rgba(0, 208, 132, 0.22);
  background: rgba(0, 208, 132, 0.1);
  color: #0f7a57;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.input-card,
.results-card,
.faq,
.cta {
  padding: 24px;
}

.results-card {
  position: sticky;
  top: 20px;
}

.section-title {
  margin: 0;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
}

.section-copy,
.faq p,
.faq li {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.site-nav {
  padding: 18px 22px;
}

.site-nav .section-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  line-height: 1.4;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(11, 26, 48, 0.08);
  border-radius: 999px;
  background: #ffffff;
  color: #25405b;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.site-nav a:hover {
  border-color: rgba(0, 208, 132, 0.22);
  color: #00b874;
  background: rgba(0, 208, 132, 0.08);
}

.form-group + .form-group {
  margin-top: 24px;
}

.form-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f8fbf9;
}

.group-title {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field,
.field-wide {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

label {
  color: #1d3652;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid rgba(11, 26, 48, 0.12);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  background-color: #ffffff;
}

select option,
select optgroup {
  background: #ffffff;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #8a98aa;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(0, 208, 132, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 208, 132, 0.12);
  background: #ffffff;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  display: none;
}

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

.items-shell {
  display: grid;
  gap: 12px;
}

.item-grid-head,
.item-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) 84px 112px 112px 74px;
  gap: 10px;
  align-items: center;
}

.item-grid-head {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.line-total-box,
.readonly-output {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(11, 26, 48, 0.1);
  border-radius: var(--radius-md);
  background: #f7fbf9;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.line-total-box {
  font-weight: 800;
}

.readonly-output {
  font-weight: 700;
}

.strong-output {
  font-size: 1.02rem;
  font-weight: 900;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #19e39b 100%);
  color: #081324;
  box-shadow: 0 18px 34px rgba(0, 208, 132, 0.22);
}

.btn-secondary {
  border-color: rgba(11, 26, 48, 0.1);
  background: linear-gradient(180deg, #ffffff, #f3faf6);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.btn-ghost {
  border-color: rgba(0, 208, 132, 0.24);
  background: rgba(0, 208, 132, 0.08);
  color: #0f7a57;
}

.btn-danger {
  min-width: 48px;
  padding: 0 12px;
  border-color: rgba(255, 107, 107, 0.18);
  background: rgba(255, 107, 107, 0.08);
  color: #b82e2e;
}

.btn-inline {
  min-height: 42px;
  padding: 0 16px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.preview-panel {
  display: grid;
  gap: 16px;
}

.preview-copy {
  display: grid;
  gap: 8px;
}

.receipt-paper {
  width: 100%;
  max-width: 100%;
  padding: 18px;
  border-radius: 24px;
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid var(--paper-line);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.receipt-topline {
  height: 5px;
  margin: -18px -18px 16px;
  background: linear-gradient(90deg, #00d084, #7be8bd);
}

.receipt-header h2 {
  margin: 0 0 8px;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.receipt-header p,
.receipt-footer p {
  margin: 4px 0 0;
  color: var(--paper-muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.optional-row,
.optional-block.is-hidden {
  display: none;
}

.receipt-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.meta-block {
  padding: 12px;
  border-radius: 16px;
  background: #f8fbf9;
  border: 1px solid var(--paper-line);
}

.meta-label {
  display: block;
  color: var(--paper-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-block strong {
  display: block;
  margin-top: 6px;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.preview-table {
  margin-top: 18px;
}

.preview-table-head,
.preview-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 52px 72px 72px;
  gap: 8px;
  align-items: center;
}

.preview-table-head {
  padding: 0 0 8px;
  color: var(--paper-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--paper-line);
}

.preview-items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.preview-item-row {
  padding: 10px 0;
  border-bottom: 1px solid #eef3f7;
  font-size: 0.92rem;
}

.preview-item-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 16px;
  border-radius: 16px;
  background: #f8fbf9;
  color: var(--paper-muted);
  border: 1px dashed var(--paper-line);
  text-align: center;
}

.preview-totals {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.preview-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--paper-muted);
}

.preview-total-row strong {
  color: var(--paper-ink);
}

.grand-row {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--paper-line);
  font-size: 1.02rem;
  color: var(--paper-ink);
}

.grand-row strong {
  font-size: 1.08rem;
}

.receipt-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-line);
}

.faq {
  margin-top: 28px;
}

.faq h2 {
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.faq h3 {
  margin: 20px 0 8px;
  font-size: 1.02rem;
}

.faq ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.cta {
  margin-top: 24px;
  background:
    radial-gradient(circle at 12% 22%, rgba(0, 208, 132, 0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(0, 208, 132, 0.12), transparent 34%),
    linear-gradient(135deg, #fbfefc, #eef8f3);
}

.cta h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  letter-spacing: -0.03em;
}

.cta p {
  color: #5f7189;
}

.cta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 18px 0 24px;
  list-style: none;
}

.cta-list li {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 208, 132, 0.08);
  border: 1px solid rgba(0, 208, 132, 0.12);
  color: #27415e;
  font-size: 0.88rem;
}

.page-shell .card:not(.site-nav) a:not(.btn),
.page-shell .cta a:not(.btn) {
  color: var(--brand-bright);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(0, 208, 132, 0.45);
  text-underline-offset: 3px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.page-shell .card:not(.site-nav) a:not(.btn):hover,
.page-shell .cta a:not(.btn):hover {
  color: #00b874;
  text-decoration-color: rgba(0, 184, 116, 0.55);
}

.sticky-cta {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand) 0%, #19e39b 100%);
  color: #081324;
  box-shadow: 0 20px 36px rgba(0, 208, 132, 0.22);
}

.whatsapp-support-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 18px 36px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.whatsapp-support-fab:hover {
  transform: translateY(-1px);
  background: #1ebe5b;
}

@media (max-width: 1020px) {
  .calculator-shell {
    grid-template-columns: 1fr;
  }

  .results-card {
    position: static;
    order: -1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 12px, 1180px);
    max-width: calc(100% - 12px);
    padding: 14px 0 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  }

  .hero,
  .input-card,
  .results-card,
  .faq,
  .cta,
  .site-nav {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .hero h1 {
    font-size: 1.72rem;
    line-height: 1.08;
  }

  .hero-copy,
  .section-copy,
  .faq p,
  .faq li {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .hero-points,
  .cta-list {
    gap: 8px;
  }

  .hero-point,
  .eyebrow,
  .cta-list li {
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .site-nav {
    padding: 12px 14px;
  }

  .site-nav .section-copy {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }

  .site-nav .section-copy::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-grid-head {
    display: none;
  }

  .item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .item-row .item-name {
    grid-column: 1 / -1;
  }

  .item-row .line-total-box,
  .item-row .remove-item-button {
    grid-column: span 1;
  }

  .preview-copy {
    gap: 6px;
  }

  .receipt-paper {
    padding: 16px;
    border-radius: 20px;
  }

  .receipt-topline {
    margin: -16px -16px 14px;
  }

  .receipt-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-table-head,
  .preview-item-row {
    grid-template-columns: minmax(0, 1.5fr) 44px 62px 62px;
    font-size: 0.84rem;
  }

  .btn {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .btn-inline {
    width: auto;
  }

  .sticky-cta {
    display: none;
  }

  .whatsapp-support-fab {
    left: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    padding: 12px;
  }

  .whatsapp-support-fab span {
    display: none;
  }
}

@media (max-width: 360px) {
  .page-shell {
    width: calc(100% - 8px);
    max-width: calc(100% - 8px);
    padding: 10px 0 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .hero,
  .input-card,
  .results-card,
  .faq,
  .cta,
  .site-nav {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .hero h1 {
    font-size: 1.42rem;
    line-height: 1.12;
  }

  .hero-copy,
  .section-copy,
  .faq p,
  .faq li {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .hero-points,
  .cta-list {
    gap: 6px;
  }

  .hero-point,
  .eyebrow,
  .cta-list li {
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .form-group {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .field-grid,
  .receipt-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-row {
    grid-template-columns: 1fr;
  }

  .item-row .line-total-box,
  .item-row .remove-item-button {
    grid-column: auto;
  }

  input,
  select,
  textarea,
  .btn,
  .line-total-box,
  .readonly-output {
    min-height: 44px;
    font-size: 0.86rem;
  }

  label {
    font-size: 0.8rem;
  }

  .receipt-paper {
    padding: 14px;
    border-radius: 18px;
  }

  .receipt-topline {
    margin: -14px -14px 12px;
  }

  .preview-table-head {
    display: none;
  }

  .preview-item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    padding: 10px 0;
  }

  .preview-item-name {
    grid-column: 1 / -1;
  }

  .meta-block,
  .receipt-footer,
  .preview-totals {
    gap: 6px;
  }

  .site-nav .section-copy {
    gap: 6px;
  }

  .site-nav a {
    min-height: 36px;
    padding: 6px 10px;
  }

  .actions .btn-primary {
    grid-column: 1 / -1;
  }
}
