:root {
  --bg-1: #061228;
  --bg-2: #0a1c3d;
  --card: rgba(10, 20, 43, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --soft: #b7c5e3;
  --muted: #8ea2c8;
  --blue: #3f76ff;
  --blue-2: #2e60dc;
  --red: #ff5d5d;
  --red-2: #e14747;
  --orange: #ff9a3d;
  --orange-2: #f17b18;
  --green: #20b46a;
  --green-2: #179157;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(70, 120, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(31, 173, 255, 0.10), transparent 26%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

.phone-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.calculator-card {
  width: min(100%, 430px);
  min-height: min(100dvh - 24px, 860px);
  padding: 18px 16px 18px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 22, 46, 0.96) 0%, rgba(8, 20, 43, 0.98) 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.header-block {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8fb0ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.12;
}

.subcopy {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field-block label,
.footer-copy {
  color: var(--soft);
  font-size: 0.95rem;
  line-height: 1.35;
}

.field-block > label {
  min-height: 20px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}

.field-block > label.inline-label {
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 5px;
  white-space: nowrap;
}

.inline-label {
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--soft);
}

.min-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
}

.ghost-label {
  visibility: hidden;
  min-height: 40px;
  display: block;
}

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-control,
.result-box {
  width: 100%;
  min-height: 40px;
  border-radius: 20px;
  border: 1px solid rgba(120, 160, 255, 0.22);
  background: rgba(20, 35, 68, 0.95);
  color: var(--text);
  font-size: 1rem;
  padding: 0 16px;
}

.field-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  color-scheme: dark;
}

.field-control::placeholder {
  color: var(--muted);
}

select.field-control {
  padding-right: 44px;
  background-color: rgba(20, 35, 68, 0.95);
  color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #9db6ff 50%),
    linear-gradient(135deg, #9db6ff 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select.field-control option,
select.field-control optgroup {
  background: #142344;
  color: #ffffff;
}

.field-control:focus {
  border-color: rgba(143, 176, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(54, 109, 255, 0.12);
}

.field-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-box {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-align: center;
  font-size: 1rem;
}

.result-blue {
  border-color: rgba(90, 136, 255, 0.7);
  background: rgba(47, 92, 208, 0.14);
}

.result-red {
  border-color: rgba(255, 98, 98, 0.75);
  background: rgba(201, 62, 62, 0.14);
}

.result-orange {
  border-color: rgba(255, 159, 74, 0.8);
  background: rgba(241, 123, 24, 0.14);
}

.money-input-wrap {
  position: relative;
  width: 100%;
}

.money-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 2;
}

.money-input {
  padding-left: 34px;
}

.budget-block {
  margin-top: 2px;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.budget-block strong {
  color: var(--text);
  font-weight: 700;
}

.budget-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.budget-title {
  color: var(--text);
  font-weight: 700;
}

.budget-chunk {
  white-space: nowrap;
}

.budget-note {
  margin-top: 8px;
  color: var(--soft);
  line-height: 1.5;
}

.footer-copy {
  padding-top: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.action-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.action-btn {
  min-height: 52px;
  border: 1px solid rgba(120, 160, 255, 0.22);
  border-radius: 18px;
  background: rgba(20, 35, 68, 0.95);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.action-btn:hover:not(:disabled):not(.disabled) {
  transform: translateY(-1px);
  border-color: rgba(143, 176, 255, 0.55);
}

.action-btn:disabled,
.action-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.action-btn-primary {
  background: linear-gradient(180deg, rgba(63, 118, 255, 0.28) 0%, rgba(46, 96, 220, 0.28) 100%);
  border-color: rgba(90, 136, 255, 0.7);
}

.action-btn-whatsapp {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(32, 180, 106, 0.24) 0%, rgba(23, 145, 87, 0.24) 100%);
  border-color: rgba(32, 180, 106, 0.48);
}

.action-feedback {
  margin: 10px 2px 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #9fd4ff;
}

.action-feedback.is-error {
  color: #ffb1b1;
}

.flyer-preview-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.flyer-preview-title {
  margin: 0 0 12px;
  color: var(--soft);
  font-size: 0.94rem;
  font-weight: 700;
}

.flyer-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.flyer-card {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    radial-gradient(circle at top right, rgba(183, 21, 42, 0.18), transparent 24%),
    linear-gradient(180deg, #071225 0%, #09172b 54%, #0b1728 100%);
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.flyer-header {
  min-height: 72px;
  padding: 8px 10px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(163, 23, 43, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(15, 31, 57, 0.98), rgba(12, 21, 39, 0.98));
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

.flyer-logo-box {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.flyer-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: scale(1.40);
  transform-origin: center;
}

.flyer-brand-copy {
  min-width: 0;
}

.flyer-overline {
  margin: 0 0 3px;
  color: #c9d6ed;
  font-size: 0.66rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flyer-brand-copy h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.08rem;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.flyer-patentamiento {
  margin: 4px 0 0;
  color: #9eb2d4;
  font-size: 0.76rem;
  line-height: 1.2;
}

.flyer-image-wrap {
  width: 100%;
  height: 278px;
  min-height: 278px;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flyer-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.flyer-finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.flyer-price-card {
  min-width: 0;
  min-height: 88px;
  padding: 5px 8px 6px;

  border-radius: 18px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  overflow: hidden;
}

.flyer-price-card--downpayment {
  border: 1px solid rgba(255, 83, 83, 0.82);
  background:
    radial-gradient(circle at center, rgba(255, 70, 70, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(120, 8, 18, 0.98), rgba(66, 5, 13, 0.98));
  box-shadow:
    inset 0 0 22px rgba(255, 28, 28, 0.12),
    0 8px 22px rgba(92, 0, 10, 0.18);
}

.flyer-price-card--installments {
  border: 1px solid rgba(255, 255, 255, 0.30);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.06), transparent 72%),
    linear-gradient(180deg, rgba(21, 30, 45, 0.99), rgba(11, 18, 30, 0.99));
}

.flyer-price-label {
  display: inline-block;
  margin-bottom: 4px;
  padding: 4px 11px;

  border-radius: 6px;
  background: linear-gradient(180deg, #e32929 0%, #b20f19 100%);
  color: #ffffff;

  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.flyer-price-value {
  display: block;
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(1.55rem, 6.2vw, 2rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.045em;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
}

.flyer-price-value.is-long {
  font-size: clamp(1.36rem, 5.5vw, 1.78rem);
}

.flyer-price-value.is-very-long {
  font-size: clamp(1.18rem, 4.8vw, 1.58rem);
}

.flyer-payment-note {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
  color: #c7d2e7;
  font-size: 0.74rem;
  line-height: 1.25;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flyer-payment-note strong {
  margin: 0 3px;
  color: #ffffff;
}

.flyer-closing {
  position: relative;
  padding: 11px 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  color: #b9c7de;
  font-size: 0.66rem;
  line-height: 1.35;
  text-align: center;
}

.flyer-closing::before {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin: 0 auto 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9232e, #ff6a4d);
}

.flyer-closing strong {
  display: block;
  margin-bottom: 3px;
  color: #ffffff;
  font-size: 0.76rem;
  line-height: 1.25;
}

.flyer-closing-brand {
  color: #ef3434;
}

.flyer-closing span {
  display: block;
}

.flyer-closing-meta {
  margin-top: 2px;
  color: #9fb0cc;
}

.helper-error,
.load-error {
  margin: 0;
  color: #ff9f9f;
  font-size: 0.84rem;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

.load-error {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 92, 92, 0.28);
  background: rgba(201, 62, 62, 0.12);
}

@media (max-width: 380px) {
  .calculator-card {
    padding: 16px 12px 14px;
  }

  .form-grid,
  .dual-grid,
  .action-panel {
    grid-template-columns: 1fr;
  }

  .field-block > label,
  .inline-label,
  .ghost-label {
    min-height: auto;
  }

  .budget-line {
    gap: 4px;
  }

  .flyer-card {
    padding: 8px;
    border-radius: 24px;
  }

  .flyer-header {
    grid-template-columns: 56px minmax(0, 1fr);
    min-height: 64px;
    padding: 7px 8px;
  }

  .flyer-logo-box {
    width: 56px;
    height: 56px;
  }

  .flyer-brand-copy h2 {
    font-size: 0.98rem;
  }

  .flyer-image-wrap {
    height: 250px;
    min-height: 250px;
  }

  .flyer-price-card {
    min-height: 100px;
    padding-inline: 6px;
  }

  .flyer-price-label {
    padding-inline: 8px;
    font-size: 0.69rem;
  }
}

.flyer-payment-note {
  width: 100%;
  min-height: auto;
  padding: 8px 12px;

  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;

  align-items: center;
  justify-items: center;
  text-align: center;
}

.flyer-payment-note > div {
  display: block;
  width: 100%;
  text-align: center;
}

.flyer-delivery-note {
  display: block;
  width: 100%;

  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.flyer-header {
  min-height: 0;
  padding: 4px 10px 2px;
}

.flyer-card {
  gap: 3px;
}

.flyer-copy-actions {
  width: 100%;
  max-width: 400px;
  margin: 10px auto 0;
  display: block;
}

.copy-flyer-btn {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;

  border: 1px solid rgba(255, 78, 78, 0.75);
  border-radius: 16px;

  background:
    linear-gradient(
      180deg,
      rgba(218, 31, 43, 0.96) 0%,
      rgba(153, 12, 24, 0.98) 100%
    );

  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;

  cursor: pointer;

  box-shadow:
    0 8px 20px rgba(129, 0, 15, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);

  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}

.copy-flyer-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.copy-flyer-btn:active:not(:disabled) {
  transform: translateY(0);
}

.copy-flyer-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}