/* ============================================
   PRECIFICA — design tokens
   Conceito: recibo / nota fiscal — cada custo é
   uma linha lançada até chegar no preço final.
   ============================================ */
:root {
  --ink:        #16212C;
  --ink-soft:   #1E2E3B;
  --ink-line:   #33465A;
  --paper:      #EFE7D4;
  --paper-dim:  #E4DAC2;
  --paper-line: #C9BB9B;
  --ink-on-paper: #241C10;
  --gold:       #C69A2E;
  --gold-deep:  #8F6D1B;
  --green:      #2E6B4F;
  --green-deep: #1F4E38;
  --muted:      #93A6B8;
  --white:      #FBF9F3;

  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 4px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* subtle grain overlay for texture, avoids flat AI-gradient look */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 999;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

/* ---------- topbar ---------- */
.topbar {
  border-bottom: 1px solid var(--ink-line);
  padding: 18px 0;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.topbar__tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ---------- hero ---------- */
.hero {
  padding: 88px 24px 56px;
  max-width: 760px;
}
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--gold);
  margin: 0 0 18px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.hero__title em {
  font-style: italic;
  color: var(--gold);
  font-weight: 500;
}
.hero__sub {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0;
}

/* ---------- calculator layout ---------- */
.calc {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding: 24px 24px 100px;
  align-items: start;
}
@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
}

.panel__title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 20px;
  font-weight: 500;
}
.panel__title--receipt { color: var(--muted); }

.panel {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 32px;
}

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--white);
}
.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

select, .input-money {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
select {
  padding: 12px 14px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393A6B8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.input-money {
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.input-money span {
  color: var(--gold);
  font-size: 0.9rem;
}
.input-money--suffix span {
  order: 2;
  color: var(--muted);
}
.input-money--suffix input { order: 1; }
.input-money input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 12px 8px 12px 4px;
  min-width: 0;
}
.input-money input::placeholder { color: var(--ink-line); }
.input-money:focus-within, select:focus {
  border-color: var(--gold);
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.4;
}

/* ---------- receipt ---------- */
.receipt-wrap { position: sticky; top: 24px; }

.receipt {
  background: var(--paper);
  color: var(--ink-on-paper);
  border-radius: 2px;
  padding: 32px 28px 40px;
  font-family: var(--font-mono);
  position: relative;
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.45);
  transform: rotate(-0.4deg);
}

.receipt__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed var(--paper-line);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.receipt__store {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.receipt__doc {
  font-size: 0.68rem;
  color: var(--gold-deep);
}

.receipt__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  padding: 7px 0;
}
.receipt__line--sub {
  border-top: 1px dashed var(--paper-line);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 600;
}
.mono { font-family: var(--font-mono); white-space: nowrap; }

.receipt__divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--gold-deep);
  margin: 14px 0;
  letter-spacing: 0.03em;
}

.receipt__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px solid var(--ink-on-paper);
  padding-top: 14px;
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}

.receipt__project {
  margin-top: 16px;
  border-top: 1px dashed var(--paper-line);
  padding-top: 10px;
}

.stamp {
  position: absolute;
  right: 26px;
  bottom: 64px;
  border: 2px solid var(--green);
  color: var(--green);
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: 50%/50%;
  transform: rotate(-11deg);
  opacity: 0.55;
  pointer-events: none;
}

.receipt__perf {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 14px;
  background: radial-gradient(circle at 8px 0, transparent 7px, var(--paper) 7.5px);
  background-size: 16px 14px;
  background-position: top;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn--pdf {
  background: var(--green);
  color: var(--white);
}
.btn--pdf:hover { background: var(--green-deep); }
.btn--pdf:active { transform: scale(0.99); }
.btn--pdf:disabled {
  background: var(--ink-line);
  color: var(--muted);
  cursor: not-allowed;
}

.pdf-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 10px 0 0;
}

/* ---------- platforms ---------- */
.platforms { padding: 20px 24px 100px; }
.platforms__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 10px;
}
.platforms__sub {
  color: var(--muted);
  margin: 0 0 40px;
  max-width: 520px;
}

.tickets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 700px) {
  .tickets { grid-template-columns: 1fr; }
}

.ticket {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}
.ticket.is-active { border-color: var(--gold); }
.ticket__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0 0 10px;
}
.ticket__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 14px;
}
.ticket__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ticket__links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 9px 0;
  border-bottom: 1px dashed var(--ink-line);
}
.ticket__links a:last-child { border-bottom: none; }
.ticket__links a:hover { color: var(--gold); }
.ticket__links a::after {
  content: "↗";
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--ink-line);
  padding: 28px 0 50px;
}
.footer__inner p {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 640px;
  margin: 0;
}

/* ---------- accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
