/* Fluxo de Nova contratação. Reutiliza tokens de main.css e componentes de contracts.css. */
.cancel-link { display: inline-flex; align-items: center; white-space: nowrap; }
.wizard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.wizard-panel { display: flex; flex-direction: column; }

/* Stepper */
.wizard-stepper { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 24px 26px 22px; border-bottom: 1px solid var(--line); }
.wizard-stepper li { position: relative; min-width: 0; }
.wizard-stepper li:not(:last-child)::after { content: ''; position: absolute; left: 44px; right: -4px; top: 17px; height: 1px; background: var(--line); }
.wizard-stepper li.done::after { background: #b9d9ce; }
.wizard-stepper button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 0; width: 100%; position: relative; z-index: 1; }
.wizard-stepper button:disabled { cursor: default; }
.wizard-node { height: 35px; width: 35px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); background: #f7f9fb; font-weight: 650; font-size: 12px; flex-shrink: 0; }
.wizard-node .icon { width: 17px; height: 17px; }
.wizard-step-copy { display: grid; min-width: 0; background: white; padding-right: 8px; }
.wizard-step-copy strong { font-size: 13px; font-weight: 650; }
.wizard-step-copy small { font-size: 11px; color: var(--muted); }
.wizard-stepper .done .wizard-node { background: var(--success-bg); color: var(--green); border-color: #c9e2d8; }
.wizard-stepper .done small { color: var(--green); }
.wizard-stepper .current .wizard-node { background: #eaf2fa; color: var(--blue); border-color: #aecbe3; box-shadow: 0 0 0 4px #25659b12; }
.wizard-stepper .current small { color: var(--blue); }
.wizard-stepper .done button:hover strong { color: var(--blue); text-decoration: underline; }
.wizard-mobile-progress { display: none; }

/* Corpo das etapas */
.wizard-body { padding: 28px 26px 8px; flex: 1; }
.step-heading { margin-bottom: 22px; outline: none; }
.step-heading h2 { font-size: 20px; letter-spacing: -.4px; }
.step-heading p { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 640px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product-option { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border: 1px solid #d4dee8; border-radius: 10px; background: white; cursor: pointer; min-height: 196px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.product-option:hover { border-color: #8ba7bf; background: #fbfcfe; }
.product-option input { position: absolute; opacity: 0; pointer-events: none; }
.product-option:has(input:focus-visible) { outline: 3px solid #367daf; outline-offset: 3px; }
.product-option.selected { border-color: var(--blue); background: #f5f9fd; box-shadow: 0 0 0 3px #25659b14; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.product-icon { width: 38px; height: 38px; border-radius: 9px; background: #edf3f9; color: #3f6d96; display: grid; place-items: center; }
.product-option.selected .product-icon { background: var(--navy); color: white; }
.product-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #c6d3df; display: grid; place-items: center; color: transparent; }
.product-check .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.product-option.selected .product-check { background: var(--blue); border-color: var(--blue); color: white; }
.product-option .eyebrow { margin: 0; font-size: 10px; }
.product-option h3 { font-size: 15px; }
.product-option p { color: var(--muted); font-size: 12px; flex: 1; }
.product-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; border-top: 1px solid #edf0f4; padding-top: 11px; margin-top: 6px; }
.product-meta span { font-size: 11px; color: var(--muted); }
.product-meta strong { font-size: 15px; font-weight: 650; white-space: nowrap; }
.product-meta strong small { font-size: 11px; color: var(--muted); font-weight: 500; }
.demo-note { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 16px; }
.demo-note .icon { width: 15px; height: 15px; }

/* Formulário */
.form-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; background: #f5f8fb; margin-bottom: 22px; font-size: 12px; color: var(--muted); }
.form-section-title { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: var(--muted); margin: 6px 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 14px; margin-bottom: 22px; }
.form-field { grid-column: span 2; min-width: 0; }
.form-field.span-3 { grid-column: span 3; }
.form-field.span-4 { grid-column: span 4; }
.form-field.span-1 { grid-column: span 1; }
.form-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.form-field label small { color: var(--muted); font-weight: 500; }
.form-field input, .form-field select, .beneficiary-row input, .beneficiary-row select { min-height: 42px; width: 100%; color: var(--ink); background: white; border: 1px solid #d4dee8; border-radius: 6px; padding: 9px 11px; font-size: 13px; }
.form-field input:focus, .form-field select:focus, .beneficiary-row input:focus, .beneficiary-row select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #25659b15; }
.form-field.invalid input, .form-field.invalid select, .beneficiary-row input.invalid { border-color: #d77b88; background: #fffafb; }
.field-error { display: none; font-size: 11px; color: #b03346; margin-top: 5px; }
.form-field.invalid .field-error { display: block; }
.field-hint { display: block; font-size: 11px; color: var(--green); margin-top: 5px; }

/* Elegibilidade */
.rule-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rule-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 20px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.rule-header .eyebrow { margin-bottom: 2px; font-size: 10px; }
.rule-header h3 { font-size: 15px; }
.rule-chain { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 22px 20px 6px; }
.rule-chain.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rule-chain li { position: relative; display: grid; gap: 4px; padding: 13px 14px; border: 1px solid #e3e9f0; border-radius: 8px; background: white; font-size: 12px; min-width: 0; transition: border-color .2s ease, background .2s ease; }
.rule-chain li:not(:last-child)::after { content: '→'; position: absolute; right: -10px; top: 50%; transform: translate(50%, -50%); color: #9aaabb; font-size: 13px; z-index: 1; }
.rule-chain small { color: var(--muted); font-size: 11px; }
.rule-chain strong { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.rule-chain li.ok { border-color: #c9e2d8; background: #f6fbf8; }
.rule-chain li.ok strong { color: var(--green); }
.rule-chain li.checking { border-color: #aecbe3; background: #f5f9fd; }
.partner-box { display: flex; align-items: center; gap: 14px; margin: 16px 20px 0; padding: 14px 16px; border-radius: 8px; background: #f5f8fb; font-size: 12px; }
.partner-box .avatar { width: 38px; height: 38px; border-radius: 9px; font-size: 11px; }
.partner-box > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.partner-box strong { font-size: 13px; }
.partner-box small { color: var(--muted); font-size: 11px; }
.rule-action { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px 20px; }
.rule-action .primary-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; }
.rule-action .primary-button:disabled { background: #7d90a5; }
.rule-action .muted { font-size: 12px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ffffff55; border-top-color: white; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-results { list-style: none; margin: 0; padding: 18px 20px 18px; display: grid; gap: 9px; }
.check-results li { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 550; color: var(--green); animation: reveal .3s ease both; }
.check-results li .check-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--success-bg); border: 1px solid #c9e2d8; }
.check-results .icon { width: 14px; height: 14px; stroke-width: 2.4; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.eligibility-result { display: flex; gap: 12px; align-items: flex-start; margin: 0 20px 20px; padding: 14px 16px; border-radius: 8px; background: var(--success-bg); border: 1px solid #c9e2d8; color: #1f5f4c; font-size: 12px; }
.eligibility-result .icon { color: var(--green); margin-top: 1px; }
.eligibility-result strong { display: block; font-size: 13px; margin-bottom: 2px; }
.iris-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 12px; color: #47637d; border-left: 3px solid #a0b8cd; background: #f1f6fb; padding: 12px 14px; border-radius: 0 6px 6px 0; }
.iris-note .icon { width: 16px; height: 16px; margin-top: 1px; color: #597c9e; }

/* Beneficiários */
.lives-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.lives-count { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.lives-count strong { font-size: 13px; color: var(--ink); }
.lives-dots { display: flex; gap: 4px; }
.lives-dots span { width: 18px; height: 6px; border-radius: 3px; background: #e2e8ef; }
.lives-dots span.on { background: var(--blue); }
.add-beneficiary { display: inline-flex; align-items: center; gap: 6px; }
.add-beneficiary:disabled { opacity: .55; cursor: not-allowed; }
.beneficiary-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.beneficiary-row { display: grid; grid-template-columns: 40px minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1fr) 40px; gap: 12px; align-items: center; padding: 14px 16px; }
.beneficiary-row + .beneficiary-row { border-top: 1px solid #edf0f4; }
.beneficiary-row.holder { background: #fafbfd; }
.beneficiary-row .avatar { width: 36px; height: 36px; font-size: 11px; }
.holder-copy { display: grid; gap: 2px; min-width: 0; }
.holder-copy strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.holder-copy small { font-size: 11px; color: var(--muted); }
.remove-beneficiary { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: #8a99a9; }
.remove-beneficiary:hover { background: var(--danger-bg); color: #b03346; }
.remove-beneficiary .icon { width: 17px; height: 17px; }
.beneficiary-row label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.beneficiary-empty { padding: 16px; font-size: 12px; color: var(--muted); border-top: 1px dashed #dbe3eb; text-align: center; }

/* Resumo */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.summary-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.summary-card > h3 { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 14px 18px; border-bottom: 1px solid #edf0f4; background: #fcfdfe; }
.summary-card > h3 .icon { color: #6b859d; width: 17px; }
.summary-card .dossier-facts { padding: 18px; gap: 14px 18px; }
.summary-card .dossier-facts dd { font-size: 12px; }
.summary-wide { grid-column: 1 / -1; }
.summary-price { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 0; }
.summary-price strong { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.3px; margin-bottom: 2px; }
.summary-price span { display: block; font-size: 11px; color: var(--muted); }
.summary-price .eyebrow { margin-bottom: 4px; font-size: 10px; }
.summary-lives { list-style: none; margin: 0; padding: 6px 18px 10px; }
.summary-lives li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 12px; }
.summary-lives li + li { border-top: 1px solid #edf0f4; }
.summary-lives small { color: var(--muted); font-size: 11px; }
.summary-checks { list-style: none; margin: 0; padding: 16px 18px; display: grid; gap: 8px; }
.summary-checks li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green); font-weight: 550; }
.summary-checks .icon { width: 15px; height: 15px; stroke-width: 2.3; }
.next-steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 20px 18px; }
.next-steps li { position: relative; display: grid; gap: 3px; font-size: 12px; min-width: 0; }
.next-steps li:not(:last-child)::after { content: ''; position: absolute; left: 36px; right: -4px; top: 14px; height: 1px; background: var(--line); }
.next-steps .step-num { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 650; background: #f7f9fb; border: 1px solid var(--line); color: var(--muted); margin-bottom: 7px; position: relative; z-index: 1; }
.next-steps li:first-child .step-num { background: #eaf2fa; color: var(--blue); border-color: #aecbe3; }
.next-steps strong { font-size: 12px; font-weight: 650; }
.next-steps small { color: var(--muted); font-size: 11px; }

/* Confirmação */
.success-state { text-align: center; padding: 26px 10px 18px; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--success-bg); color: var(--green); border: 1px solid #c9e2d8; box-shadow: 0 0 0 8px #eaf5ef80; }
.success-mark .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.success-state h2 { font-size: 24px; }
.success-state > p { color: var(--muted); font-size: 13px; max-width: 560px; margin: 8px auto 0; }
.success-id { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 16px; border-radius: 8px; background: #f5f8fb; border: 1px dashed #c3d1de; font-size: 12px; color: var(--muted); }
.success-id strong { color: var(--blue); font-size: 15px; letter-spacing: .3px; }
.success-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 640px; margin: 22px auto 0; text-align: left; }
.success-facts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.success-facts dt { font-size: 11px; color: var(--muted); }
.success-facts dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.success-actions a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; }
.success-actions .icon { width: 15px; height: 15px; }
.success-state .detail-note { max-width: 640px; margin: 22px auto 0; text-align: left; }

/* Mensagens e rodapé */
.wizard-message { display: flex; align-items: center; gap: 10px; margin: 14px 26px 0; padding: 12px 16px; border-radius: 8px; border: 1px solid #ead6ae; background: var(--warning-bg); color: #795014; font-size: 12px; animation: reveal .2s ease both; }
.wizard-message .icon { width: 17px; height: 17px; }
.wizard-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 26px; margin-top: 22px; border-top: 1px solid var(--line); background: #fafbfd; }
.wizard-cancel { font-size: 12px; }
.wizard-buttons { display: flex; gap: 10px; }
.wizard-buttons button { min-width: 120px; min-height: 42px; }
.wizard-buttons .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.wizard-buttons .primary-button .icon { width: 15px; height: 15px; }
.wizard-buttons .secondary-button:disabled { opacity: .45; cursor: default; }

/* Resumo lateral */
.wizard-aside { position: sticky; top: 20px; }
.wizard-aside .panel-heading { border-bottom: 1px solid #edf0f4; }
.wizard-aside h2 { font-size: 15px; letter-spacing: -.2px; }
.aside-list { margin: 0; padding: 6px 22px 8px; }
.aside-list > div { display: grid; gap: 2px; padding: 12px 0; }
.aside-list > div + div { border-top: 1px solid #edf0f4; }
.aside-list dt { font-size: 11px; color: var(--muted); }
.aside-list dd { margin: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.aside-list dd.pending { color: #9aa8b6; font-weight: 500; }
.aside-price { display: flex; align-items: baseline; gap: 4px; }
.aside-price strong { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.aside-price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.wizard-aside .panel-note { margin-top: 0; }

@media (max-width: 1199px) {
  .wizard-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
  .wizard-stepper { padding-inline: 20px; gap: 8px; }
  .wizard-step-copy small { display: none; }
  .wizard-body { padding-inline: 22px; }
  .wizard-footer { padding-inline: 22px; }
  .wizard-message { margin-inline: 22px; }
  .rule-chain { grid-template-columns: 1fr 1fr; gap: 12px 22px; }
  .rule-chain li:nth-child(2)::after { display: none; }
}
@media (max-width: 1023px) {
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-aside { position: static; }
  .aside-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
  .aside-list > div + div { border-top: 0; }
  .wizard-stepper .wizard-step-copy strong { font-size: 12px; }
  .next-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  .next-steps li:nth-child(3)::after { display: none; }
}
@media (max-width: 700px) {
  .new-contract-page .commercial-heading { margin-bottom: 18px; }
  .wizard-stepper { padding: 18px 16px 12px; gap: 0; border-bottom: 0; }
  .wizard-stepper li:not(:last-child)::after { left: 34px; right: 0; top: 14px; }
  .wizard-stepper button { justify-content: flex-start; }
  .wizard-step-copy { display: none; }
  .wizard-node { width: 29px; height: 29px; font-size: 11px; }
  .wizard-mobile-progress { display: grid; gap: 8px; padding: 0 16px 16px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; }
  .wizard-progress-track { height: 4px; border-radius: 2px; background: #e8eef4; overflow: hidden; }
  .wizard-progress-track span { display: block; height: 100%; background: var(--blue); transition: width .2s ease; }
  .wizard-body { padding: 22px 16px 4px; }
  .step-heading h2 { font-size: 18px; }
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-option { min-height: 0; }
  .form-toolbar { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .form-field, .form-field.span-3, .form-field.span-4 { grid-column: 1 / -1; }
  .form-field.span-1, .form-field.half { grid-column: span 1; }
  .form-field input, .form-field select, .beneficiary-row input, .beneficiary-row select { font-size: 16px; }
  .rule-header { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .rule-chain, .rule-chain.three { grid-template-columns: 1fr; padding: 16px 16px 4px; gap: 18px; }
  .rule-chain li:not(:last-child)::after { content: '↓'; right: auto; left: 50%; top: auto; bottom: -9px; transform: translate(-50%, 50%); display: block; }
  .partner-box { margin-inline: 16px; flex-wrap: wrap; gap: 10px 14px; }
  .partner-box > div { flex-basis: calc(100% - 52px); }
  .partner-box .badge { margin-left: 52px; }
  .rule-action { padding-inline: 16px; }
  .rule-action .primary-button { width: 100%; justify-content: center; }
  .check-results { padding-inline: 16px; }
  .eligibility-result { margin-inline: 16px; }
  .beneficiary-row { grid-template-columns: 36px minmax(0, 1fr) 36px; padding: 14px; }
  .beneficiary-row.holder > :nth-child(n+3) { display: none; }
  .beneficiary-row .rel-field, .beneficiary-row .birth-field { grid-column: 2 / 3; }
  .beneficiary-row .remove-beneficiary { grid-column: 3; grid-row: 1; }
  .lives-bar .add-beneficiary { width: 100%; justify-content: center; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card .dossier-facts { grid-template-columns: 1fr 1fr; }
  .next-steps { grid-template-columns: 1fr; gap: 12px; }
  .next-steps li { grid-template-columns: 29px 1fr; column-gap: 12px; }
  .next-steps .step-num { grid-row: span 2; margin-bottom: 0; }
  .next-steps li:not(:last-child)::after { display: block; left: 14px; right: auto; top: 32px; bottom: -12px; width: 1px; height: auto; }
  .next-steps li:nth-child(3)::after { display: block; }
  .success-facts { grid-template-columns: 1fr; }
  .success-actions a { width: 100%; justify-content: center; }
  .wizard-message { margin: 12px 16px 0; }
  .wizard-footer { padding: 14px 16px; flex-direction: column-reverse; align-items: stretch; gap: 10px; margin-top: 18px; }
  .wizard-cancel { justify-content: center; }
  .wizard-buttons { display: grid; grid-template-columns: 1fr 1.4fr; }
  .wizard-buttons button { min-width: 0; }
  .wizard-aside { display: none; }
}
