:root {
  --navy: #10283f;
  --navy-2: #173d5e;
  --gold: #d8a84e;
  --gold-soft: #f5ead2;
  --ink: #182635;
  --muted: #667583;
  --line: #dce4e9;
  --paper: #ffffff;
  --canvas: #f2f5f7;
  --success: #19704e;
  --success-soft: #e7f5ed;
  --warning: #8a5a00;
  --warning-soft: #fff5d9;
  --danger: #a23838;
  --danger-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(16, 40, 63, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 100% 0, #e9eef2 0, transparent 36rem), var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.page-shell { min-height: calc(100vh - 160px); padding-block: 38px 64px; }

.site-header { position: sticky; z-index: 20; top: 0; color: #fff; background: rgba(16, 40, 63, .96); border-bottom: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(14px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border-radius: 50%; font-weight: 900; letter-spacing: -.04em; }
.brand > span:last-child { display: grid; }
.brand strong { letter-spacing: .02em; }
.brand small { color: #c9d4dd; font-size: .75rem; }
.top-nav { display: flex; align-items: center; gap: 18px; }
.top-nav > a:not(.button) { color: #dce5eb; text-decoration: none; }
.top-nav form { margin: 0; }

.button { appearance: none; display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border: 1px solid var(--gold); border-radius: 10px; color: var(--navy); background: var(--gold); box-shadow: 0 6px 18px rgba(216, 168, 78, .2); cursor: pointer; font-weight: 800; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(16, 40, 63, .15); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, canvas:focus-visible { outline: 3px solid rgba(216,168,78,.45); outline-offset: 2px; }
.button-small { min-height: 38px; padding: 7px 14px; font-size: .9rem; }
.button-wide { width: 100%; }
.button-secondary { color: var(--navy); border-color: #bccbd5; background: #fff; box-shadow: none; }
.button-whatsapp { color: #fff; border-color: #187c4f; background: #187c4f; }
.link-button { appearance: none; padding: 4px 0; color: inherit; background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.top-nav .link-button { color: #dce5eb; }
.text-link, .back-link { color: var(--navy-2); font-weight: 750; text-underline-offset: 3px; }
.back-link { display: inline-block; margin-bottom: 7px; text-decoration: none; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; color: var(--navy); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.04; letter-spacing: -.025em; }
h2 { margin-bottom: 8px; color: var(--navy); font-size: 1.25rem; line-height: 1.25; }
.eyebrow { margin-bottom: 7px; color: #9a6c18; font-size: .75rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); }
.center { text-align: center; }
.fine-print { margin-top: 24px; color: var(--muted); font-size: .8rem; }
.mono { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-heading { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading p:last-child { margin-bottom: 0; }
.auth-wrap { min-height: 65vh; display: grid; place-items: center; }
.auth-card { width: min(460px, 100%); padding: 38px; }
.stack { display: grid; gap: 18px; }
.site-footer { padding: 24px 0; color: #75828c; border-top: 1px solid var(--line); font-size: .8rem; text-align: center; }

label { display: grid; gap: 7px; color: #314454; font-size: .9rem; font-weight: 750; }
input, textarea, select { width: 100%; padding: 12px 13px; color: var(--ink); background: #fff; border: 1px solid #b9c7d0; border-radius: 9px; box-shadow: inset 0 1px 2px rgba(16,40,63,.03); }
textarea { resize: vertical; }
input[readonly] { background: #f5f7f8; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.span-2 { grid-column: span 2; }
.contract-form { display: grid; gap: 22px; }
.form-section { padding: 28px; }
.section-heading { margin-bottom: 24px; display: flex; gap: 15px; align-items: flex-start; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.section-heading > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--navy); background: var(--gold-soft); border: 1px solid #e6c887; border-radius: 50%; font-weight: 900; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }

.flash { margin-bottom: 18px; padding: 13px 16px; border: 1px solid; border-radius: 10px; font-weight: 700; }
.flash-success { color: var(--success); background: var(--success-soft); border-color: #b9dfc9; }
.flash-warning { color: var(--warning); background: var(--warning-soft); border-color: #ead28f; }
.flash-error { color: var(--danger); background: var(--danger-soft); border-color: #efbcbc; }
.flash-info { color: var(--navy-2); background: #eaf2f8; border-color: #c4dae9; }

.stats-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { padding: 21px 24px; background: linear-gradient(135deg, #fff, #f8fafb); border: 1px solid var(--line); border-radius: 13px; }
.stat strong { display: block; color: var(--navy); font-family: Georgia, serif; font-size: 2rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); background: #f7f9fa; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); }
.empty-state { padding: 60px 24px; text-align: center; }
.status { display: inline-flex; padding: 5px 9px; color: var(--navy-2); background: #eaf2f8; border-radius: 999px; font-size: .75rem; font-weight: 850; white-space: nowrap; }
.status-draft, .status-company_signed { color: #725015; background: var(--gold-soft); }
.status-signed { color: var(--success); background: var(--success-soft); }
.status-expired { color: var(--danger); background: var(--danger-soft); }
.status-large { padding: 8px 13px; }

.workflow { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.workflow-step { position: relative; padding: 17px; display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; border-right: 1px solid var(--line); }
.workflow-step:last-child { border-right: 0; }
.workflow-step > span { grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #edf1f3; font-weight: 900; }
.workflow-step strong { color: var(--navy); font-size: .88rem; }
.workflow-step small { color: var(--muted); }
.workflow-step.done > span { color: #fff; background: var(--success); }
.workflow-step.active > span { color: var(--navy); background: var(--gold); }
.detail-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.action-column { display: grid; gap: 18px; position: sticky; top: 98px; }
.action-card, .metadata-card { padding: 24px; }
.action-card p:not(.eyebrow), .metadata-card p { color: var(--muted); }
.success-card { background: linear-gradient(150deg, #fff, var(--success-soft)); border-color: #b9dfc9; }
.metadata-card dl { margin: 0; display: grid; gap: 14px; }
.metadata-card dl div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.metadata-card dl div:last-child { padding-bottom: 0; border-bottom: 0; }
.metadata-card dt { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.metadata-card dd { margin: 3px 0 0; }
.share-panel { margin-bottom: 20px; padding: 24px; display: grid; grid-template-columns: 1fr 1.5fr; gap: 25px; align-items: center; border-color: #e1c37d; background: linear-gradient(120deg, #fff, #fbf4e5); }
.share-panel p { margin-bottom: 0; color: var(--muted); }
.share-box { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }

.document-panel { padding: clamp(26px, 5vw, 58px); }
.contract-document { max-width: 780px; margin: 0 auto; color: #202c36; font-family: Georgia, "Times New Roman", serif; line-height: 1.7; }
.contract-document h1 { margin-bottom: 6px; text-align: center; font-size: 1.65rem; line-height: 1.22; }
.contract-subtitle { margin-bottom: 34px; color: var(--muted); text-align: center; font-style: italic; }
.contract-document h2 { margin: 30px 0 12px; padding-bottom: 7px; color: var(--navy); border-bottom: 1px solid #cad5dc; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .95rem; letter-spacing: .035em; }
.contract-document p { text-align: justify; }
.contract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: #d5dee4; border: 1px solid #d5dee4; border-radius: 8px; }
.contract-grid div { padding: 10px 12px; background: #fff; }
.contract-grid dt { color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.contract-grid dd { margin: 2px 0 0; }
.document-hash { padding: 12px; background: #f4f6f7; border-radius: 7px; overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: .72rem; }

.signature-pad { position: relative; height: 170px; margin: 14px 0 8px; overflow: hidden; background: #fff; border: 2px dashed #9db0bd; border-radius: 10px; touch-action: none; }
.signature-pad-large { height: 230px; }
.signature-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.signature-pad > span { position: absolute; z-index: 1; left: 50%; bottom: 10px; translate: -50% 0; color: #a8b4bc; font-size: .78rem; pointer-events: none; }
.signature-form > .button { margin-top: 14px; }
.signing-heading { margin: 10px auto 28px; max-width: 820px; text-align: center; }
.signing-heading p:last-child { color: var(--muted); }
.verification-card { max-width: 820px; margin: 0 auto 20px; padding: 24px; display: flex; align-items: center; gap: 18px; }
.verification-card p { margin-bottom: 14px; color: var(--muted); }
.verification-card h2 { margin-bottom: 4px; }
.verification-number { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; color: var(--navy); background: var(--gold-soft); border-radius: 50%; font-weight: 900; }
.verified-card { border-color: #b9dfc9; }
.verified-card .verification-number { color: #fff; background: var(--success); }
.signing-document { max-width: 920px; margin-inline: auto; }
.inline-form { display: flex; gap: 10px; }
.otp-input { width: 180px; font-size: 1.45rem; font-weight: 900; letter-spacing: .22em; text-align: center; }
.resend-form { margin-top: 10px; }
.final-sign-card { max-width: 820px; margin: 20px auto 0; padding: clamp(24px, 5vw, 42px); }
.accept-row { margin: 22px 0 6px; display: grid; grid-template-columns: auto 1fr; align-items: flex-start; gap: 10px; font-weight: 600; }
.accept-row input { width: 20px; height: 20px; margin-top: 2px; }
.completion-card { width: min(680px, 100%); margin: 8vh auto; padding: 48px; text-align: center; }
.completion-icon { width: 72px; height: 72px; margin: 0 auto 20px; display: grid; place-items: center; color: #fff; background: var(--success); border-radius: 50%; font-size: 2rem; font-weight: 900; }

.install-shell { padding-block: 48px 72px; }
.install-heading { max-width: 760px; margin-bottom: 28px; }
.requirements { margin-bottom: 22px; padding: 24px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { padding: 6px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.check-ok { color: var(--success); background: var(--success-soft); }
.check-fail { color: var(--danger); background: var(--danger-soft); }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .action-column { position: static; }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .workflow-step:nth-child(2) { border-right: 0; }
  .workflow-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .share-panel { grid-template-columns: 1fr; }
  .share-box { grid-template-columns: 1fr 1fr; }
  .share-box input { grid-column: span 2; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 22px, 1180px); }
  .header-inner { min-height: 68px; }
  .brand small { display: none; }
  .top-nav > a:not(.button) { display: none; }
  .top-nav { gap: 10px; }
  .page-shell { padding-block: 26px 48px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-section, .auth-card, .document-panel { padding: 22px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .workflow { grid-template-columns: 1fr; }
  .workflow-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-step:last-child { border-bottom: 0; }
  .contract-grid { grid-template-columns: 1fr; }
  .contract-document h1 { font-size: 1.3rem; }
  .contract-document p { text-align: left; }
  .share-box { grid-template-columns: 1fr; }
  .share-box input { grid-column: auto; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .otp-input { width: 100%; }
  .verification-card { align-items: flex-start; }
  .completion-card { margin-block: 3vh; padding: 30px 22px; }
}

@media print {
  .site-header, .site-footer, .action-column, .workflow, .share-panel, .flash { display: none !important; }
  body, html { background: #fff; }
  .page-shell { padding: 0; }
  .detail-grid { display: block; }
  .document-panel { border: 0; box-shadow: none; padding: 0; }
}
