:root {
  --navy: #0e223b;
  --navy-2: #132d4d;
  --gold: #d79b22;
  --gold-soft: #f8edcd;
  --gray-50: #f7f8fa;
  --gray-100: #f0f2f5;
  --gray-200: #d9dee8;
  --gray-500: #667085;
  --text: #101d33;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(14, 34, 59, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(215, 155, 34, 0.12), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  min-height: 100vh;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 0;
  padding: 18px 22px;
  border: 1px solid rgba(14, 34, 59, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 35px rgba(14, 34, 59, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: var(--gold);
  font-weight: 900;
  letter-spacing: -0.04em;
  border: 1px solid rgba(215, 155, 34, 0.35);
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow.gold { color: var(--gold); }

h1, h2, h3, h4, p { margin-top: 0; }

h1 { margin-bottom: 0; font-size: clamp(1.1rem, 2.4vw, 1.45rem); }
h2 { margin-bottom: 10px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.02; letter-spacing: -0.05em; }
h3 { margin-bottom: 6px; font-size: 1.1rem; }
h4 { margin-bottom: 12px; font-size: 0.95rem; }

.topbar-note {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: right;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 60px;
}

.hero-card {
  padding: clamp(24px, 5vw, 46px);
  background: linear-gradient(135deg, var(--navy) 0%, #18375f 100%);
  color: var(--white);
  border-radius: 32px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 310px;
  height: 310px;
  background: rgba(215, 155, 34, 0.18);
  border-radius: 50%;
}

.hero-card > * { position: relative; z-index: 1; }
.hero-card .muted { color: rgba(255, 255, 255, 0.78); max-width: 780px; line-height: 1.65; }

.hero-badge {
  width: 128px;
  height: 128px;
  flex: 0 0 auto;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-badge span { color: var(--gold); font-size: 0.76rem; font-weight: 900; letter-spacing: 0.1em; }
.hero-badge strong { display: block; font-size: 2.2rem; line-height: 1; }

.grid { display: grid; gap: 22px; margin-top: 22px; }
.two-columns { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: start; }

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(14, 34, 59, 0.09);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(14, 34, 59, 0.07);
  padding: clamp(18px, 3vw, 28px);
}

.panel-header { margin-bottom: 18px; }
.panel-header p { margin-bottom: 0; color: var(--gray-500); font-size: 0.92rem; line-height: 1.5; }
.panel-header.inline { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--navy);
}
.required > span::after { content: " *"; color: var(--gold); }

input, select {
  width: 100%;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus, select:focus {
  border-color: rgba(215, 155, 34, 0.7);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(215, 155, 34, 0.14);
}

.input-unit { position: relative; }
.input-unit input { padding-right: 52px; }
.input-unit span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-weight: 800;
}

.package-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.package-card {
  cursor: pointer;
  position: relative;
  padding: 15px 12px;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  text-align: center;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.package-card input { position: absolute; opacity: 0; pointer-events: none; }
.package-card span { display: block; font-weight: 900; color: var(--navy); }
.package-card small { display: block; margin-top: 4px; color: var(--gray-500); font-size: 0.75rem; }
.package-card:has(input:checked) {
  border-color: rgba(215, 155, 34, 0.75);
  background: var(--gold-soft);
  transform: translateY(-1px);
}
.package-card.recommended::before {
  content: "★";
  position: absolute;
  top: -9px;
  right: -7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: white;
  font-size: 0.72rem;
}

.actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; }
.actions.stacked { flex-direction: column; align-items: stretch; }
button {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); opacity: 0.86; }
.primary-button { background: var(--navy); color: white; box-shadow: 0 10px 24px rgba(14, 34, 59, 0.18); }
.secondary-button { background: var(--gray-100); color: var(--navy); }

.result-panel { position: sticky; top: 18px; }

.price-card {
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--gold-soft), #fff6dc);
  border: 1px solid rgba(215, 155, 34, 0.32);
}
.price-card p { margin-bottom: 4px; color: var(--gray-500); font-size: 0.85rem; font-weight: 800; }
.price-card strong { display: block; font-size: 2.1rem; color: var(--navy); letter-spacing: -0.04em; }
.price-card span { color: var(--gold); font-size: 0.82rem; font-weight: 900; }

.amount-row, .payment-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}
.amount-row span, .payment-row span { color: var(--gray-500); }
.amount-row strong, .payment-row strong { color: var(--navy); }
.amount-row.total {
  margin-top: 6px;
  border-bottom: 0;
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--navy);
  color: white;
}
.amount-row.total span, .amount-row.total strong { color: white; }
.amount-row.total strong { font-size: 1.7rem; }
.amount-row.subtle { font-size: 0.86rem; }

.payment-box, .formula-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.payment-box h4, .formula-box h4 { color: var(--navy); }
.payment-row:last-child { border-bottom: 0; }

.formula-box ul { margin: 0; padding-left: 18px; color: var(--gray-500); line-height: 1.7; }
.formula-box li strong { color: var(--navy); }

.table-panel { margin-top: 22px; }
.table-wrapper { overflow-x: auto; border-radius: 18px; border: 1px solid var(--gray-200); }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 15px 16px; text-align: right; border-bottom: 1px solid var(--gray-200); }
th:first-child, td:first-child { text-align: left; }
th { background: var(--navy); color: white; font-size: 0.86rem; }
tbody tr:nth-child(even) { background: var(--gray-50); }
tbody tr:hover { background: #fff8e6; }
td { font-weight: 800; color: var(--navy); }
.table-note { margin: 14px 0 0; color: var(--gray-500); font-size: 0.9rem; line-height: 1.55; }
.pill {
  flex: 0 0 auto;
  background: var(--gold-soft);
  color: #8a5b08;
  border: 1px solid rgba(215, 155, 34, 0.3);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 900;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: var(--navy);
  color: white;
  padding: 13px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-weight: 800;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .two-columns { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .hero-badge { width: 96px; height: 96px; border-radius: 24px; }
  .hero-badge strong { font-size: 1.75rem; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-note { text-align: left; }
  .package-options { grid-template-columns: 1fr; }
  .actions { flex-direction: column; align-items: stretch; }
  .panel-header.inline { flex-direction: column; align-items: flex-start; }
  .amount-row.total { align-items: flex-start; flex-direction: column; }
}

@media print {
  body { background: white; }
  .topbar, .hero-card, form, .table-panel, .actions, .toast { display: none !important; }
  .container { width: 100%; margin: 0; }
  .two-columns { display: block; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
  .result-panel { position: static; }
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--navy);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 900;
  border: 1px solid rgba(14, 34, 59, 0.08);
}

.logout-link:hover { background: var(--gold-soft); }

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-layout {
  width: min(100%, 460px);
}

.login-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(14, 34, 59, 0.09);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 36px);
}

.login-brand {
  margin-bottom: 20px;
}

.login-brand h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  letter-spacing: -0.04em;
}

.login-intro {
  color: var(--gray-500);
  line-height: 1.55;
  margin-bottom: 22px;
}

.login-alert {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff1f1;
  color: #8a1f1f;
  border: 1px solid #f2c7c7;
  margin-bottom: 16px;
  font-weight: 800;
  font-size: 0.9rem;
}

.full-button {
  width: 100%;
  margin-top: 6px;
}

.login-footnote {
  margin: 18px 0 0;
  color: var(--gray-500);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 620px) {
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .logout-link { display: none !important; }
}

#quotePrintArea {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 12mm 15mm 14mm;
  }

  body.is-printing {
    background: white !important;
    color: #0e223b;
  }

  body.is-printing .topbar,
  body.is-printing main.container,
  body.is-printing .toast {
    display: none !important;
  }

  body.is-printing #quotePrintArea {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #0e223b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10.7pt;
    line-height: 1.47;
  }

  body.is-printing #quotePrintArea::after {
    content: "mmverificacioninmobiliaria.com       999 965 7257  |  999 313 3002";
    position: fixed;
    left: 15mm;
    right: 15mm;
    bottom: 6mm;
    border-top: 1.5px solid #0e223b;
    padding-top: 2mm;
    color: #667085;
    font-size: 8pt;
    text-align: center;
  }

  .quote-document,
  .quote-document * {
    box-sizing: border-box;
  }

  .print-page {
    position: relative;
    break-after: page;
    page-break-after: always;
    min-height: 255mm;
    padding-bottom: 10mm;
    background: #fff;
  }

  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .quote-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding: 28mm 0 38mm;
  }

  .quote-logo {
    display: inline-flex;
    white-space: nowrap;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #0e223b;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 800;
    letter-spacing: -0.045em;
    text-transform: uppercase;
  }

  .quote-logo span {
    display: block;
    margin-top: 2mm;
    color: #0e223b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8.5pt;
    letter-spacing: 0.17em;
    font-weight: 700;
  }

  .quote-logo.large {
    font-size: 35pt;
    margin-top: 8mm;
  }

  .quote-logo.small {
    position: absolute;
    right: 0;
    top: -1mm;
    width: 48mm;
    text-align: center;
    font-size: 11pt;
  }

  .quote-logo.small span {
    font-size: 4pt;
    letter-spacing: 0.1em;
  }

  .cover-center h1 {
    margin: 0 0 6mm;
    color: #0e223b;
    font-size: 28pt;
    line-height: 1.1;
    font-weight: 800;
  }

  .cover-center p {
    margin: 0;
    color: #d79b22;
    font-size: 14pt;
    font-weight: 800;
    letter-spacing: 0.015em;
  }

  .gold-line {
    width: 175mm;
    height: 1.5mm;
    background: #d79b22;
    margin: 28mm auto 4mm;
  }

  .cover-center h2 {
    margin: 0;
    color: #0e223b;
    font-size: 17pt;
    font-weight: 800;
    letter-spacing: -0.03em;
  }

  .cover-bottom p {
    margin: 0 0 4mm;
    color: #667085;
    font-size: 12pt;
  }

  .cover-bottom strong {
    display: block;
    margin-bottom: 3mm;
    color: #667085;
    font-size: 10pt;
    letter-spacing: 0.02em;
  }

  .cover-bottom span {
    color: #667085;
    font-size: 10pt;
  }

  .quote-summary {
    padding-top: 12mm;
  }

  .quote-summary h1,
  .quote-content h2,
  .quote-section h2 {
    margin: 0 0 7mm;
    color: #0e223b;
    font-size: 21pt;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.05em;
  }

  .quote-summary > h2 {
    margin: 0 0 6mm;
    color: #0e223b;
    font-size: 13.5pt;
    font-weight: 900;
    letter-spacing: -0.03em;
  }

  .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5mm 16mm;
    background: #f1f3f6;
    padding: 4mm 5mm;
    margin: 0 0 10mm;
  }

  .info-grid span {
    display: block;
    color: #d79b22;
    font-size: 7.5pt;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 1.5mm;
  }

  .info-grid strong {
    display: block;
    color: #0e223b;
    font-size: 9pt;
    font-weight: 900;
  }

  .objective-box {
    margin: 0 0 18mm;
    padding: 4mm 5mm 4mm 10mm;
    background: #eaf0f6;
    border-left: 6mm solid #0e223b;
  }

  .objective-box h3 {
    margin: 0 0 2mm;
    color: #0e223b;
    font-size: 11pt;
    font-weight: 900;
  }

  .objective-box p {
    margin: 0;
    color: #1f2937;
    font-size: 10pt;
    line-height: 1.5;
  }

  .block-title {
    margin: 0 0 4mm !important;
    color: #0e223b !important;
    font-size: 16pt !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
  }

  .investment-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 92%;
    margin: 0 auto;
  }

  .investment-card {
    background: #f3f4f6;
    min-height: 28mm;
    text-align: center;
    padding: 5mm 3mm;
  }

  .investment-card.selected {
    background: #f8edcd;
  }

  .investment-card p {
    margin: 0 0 3mm;
    color: #667085;
    font-size: 7.5pt;
    font-weight: 900;
  }

  .investment-card.selected p {
    color: #d79b22;
  }

  .investment-card strong {
    display: block;
    color: #0e223b;
    font-size: 17pt;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
  }

  .investment-card span {
    display: block;
    color: #667085;
    margin-top: 3mm;
    font-size: 8pt;
    font-weight: 900;
  }

  .investment-note {
    margin: 2mm 0 10mm;
    text-align: center;
    color: #667085;
    font-size: 8.2pt;
    font-style: italic;
  }

  .quote-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 10mm;
    font-size: 10.5pt;
  }

  .quote-table th,
  .quote-table td {
    padding: 4mm 5mm;
    border: 0.5pt solid #cfd6e2;
    text-align: center;
  }

  .quote-table th {
    background: #0e223b !important;
    color: #fff !important;
    font-size: 10.5pt;
    font-weight: 900;
  }

  .quote-table td:first-child {
    font-weight: 900;
    color: #0e223b;
  }

  .quote-table .selected-row td {
    background: #f8edcd !important;
  }

  .selected-package-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8mm;
    align-items: center;
    padding: 5mm 6mm;
    margin: -3mm 0 8mm;
    background: #eaf0f6;
    border-left: 5mm solid #0e223b;
  }

  .selected-package-box h3 {
    margin: 0;
    color: #0e223b;
    font-size: 12pt;
    font-weight: 900;
  }

  .selected-package-box div {
    text-align: right;
  }

  .selected-package-box span,
  .selected-package-box strong {
    display: block;
  }

  .selected-package-box span {
    color: #d79b22;
    font-size: 9pt;
    font-weight: 900;
    text-transform: uppercase;
  }

  .selected-package-box strong {
    color: #0e223b;
    font-size: 18pt;
    line-height: 1.1;
    font-weight: 900;
  }

  .payment-table {
    margin-bottom: 9mm;
  }

  .quote-summary > p,
  .quote-content p,
  .quote-section p {
    margin: 0 0 4mm;
    color: #1f2937;
    font-size: 10.8pt;
    line-height: 1.6;
  }

  .quote-content {
    padding-top: 4mm;
  }

  .quote-section h3 {
    margin: 0 0 2mm;
    color: #0e223b;
    font-size: 15pt;
    font-weight: 900;
    letter-spacing: -0.025em;
  }

  .section-subtitle {
    color: #d79b22 !important;
    font-size: 12pt !important;
    font-weight: 900 !important;
    margin-bottom: 5mm !important;
  }

  .scope-box,
  .deliverables {
    margin: 5mm 0 7mm;
    padding: 5mm 6mm;
    background: #f3f4f6;
    border-left: 4mm solid #d79b22;
  }

  .scope-box h4,
  .deliverables h4,
  .scope-card h4 {
    margin: 0 0 2.5mm;
    color: #0e223b;
    font-size: 11.5pt;
    font-weight: 900;
  }

  .scope-box ul,
  .deliverables ul,
  .scope-card ul {
    margin: 0 0 2mm;
    padding-left: 5mm;
  }

  .scope-box li,
  .deliverables li,
  .scope-card li,
  .limitations-list li {
    margin: 0 0 1.8mm;
    color: #1f2937;
    font-size: 10pt;
    line-height: 1.48;
  }

  .scope-note {
    margin: 3mm 0 0 !important;
    color: #667085 !important;
    font-size: 9.5pt !important;
    font-style: italic;
  }

  .scope-grid {
    display: block;
  }

  .scope-card {
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 0 0 4mm;
    margin: 0 0 4mm;
    border-bottom: 0.5pt solid #d9dee8;
  }

  .keep-together {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .conditions-list {
    margin: 0 0 8mm;
  }

  .condition-row {
    display: grid;
    grid-template-columns: 45mm 1fr;
    gap: 5mm;
    padding: 2.8mm 0;
    border-bottom: 0.5pt solid #d9dee8;
  }

  .condition-row strong {
    color: #0e223b;
    font-size: 10pt;
    font-weight: 900;
  }

  .condition-row span {
    color: #1f2937;
    font-size: 10pt;
    line-height: 1.5;
  }

  .limitations-list {
    margin: 0;
    padding-left: 6mm;
  }

  .limitations-list li {
    padding-left: 1mm;
    margin-bottom: 2.3mm;
  }
}

@media print {
  body.is-printing .quote-table {
    min-width: 0 !important;
  }
}

@media print {
  body.is-printing .quote-summary > h1 {
    padding-right: 50mm;
  }
}
