:root {
    --green-950: #06351f;
    --green-900: #08472a;
    --green-800: #0b5d35;
    --green-700: #0f7142;
    --green-600: #168250;
    --green-100: #e8f4ed;
    --green-50: #f4faf6;

    --ink-950: #101813;
    --ink-900: #17211b;
    --ink-700: #405047;
    --ink-600: #55645b;
    --ink-500: #66756c;

    --line: #d8e2dc;
    --surface: #ffffff;
    --surface-muted: #f7faf8;

    --warning: #9a5b00;
    --warning-bg: #fff8e9;
    --danger: #a12622;
    --danger-bg: #fff2f1;
    --focus: #0c6fd7;

    --shadow: 0 18px 50px rgba(6, 53, 31, 0.13);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 9px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    padding:
        max(28px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(28px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));
    color: var(--ink-900);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.15), transparent 30rem),
        linear-gradient(145deg, var(--green-950), var(--green-800));
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

button,
input,
textarea {
    font: inherit;
}

button,
label,
input[type="checkbox"],
input[type="radio"] {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
    max-width: 100%;
}

a {
    color: var(--green-800);
    font-weight: 700;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--green-950);
}

[hidden] {
    display: none !important;
}

.site-shell {
    width: min(100%, 960px);
    margin: 0 auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 28px 38px;
    color: #ffffff;
    background: linear-gradient(120deg, var(--green-950), var(--green-700));
}

.brand-logo {
    width: 124px;
    max-width: 32%;
    max-height: 72px;
    object-fit: contain;
    padding: 8px;
    background: #ffffff;
    border-radius: var(--radius-sm);
}

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

.eyebrow,
.step-label {
    margin: 0 0 5px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.brand-header .eyebrow {
    color: #c9ead7;
}

h1,
h2,
p,
legend,
label,
small {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.15;
}

h2 {
    margin: 0;
    color: var(--green-950);
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.25;
}

.progress {
    padding: 22px 38px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
}

.progress ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.progress li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--ink-500);
    font-size: 0.78rem;
    text-align: center;
}

.progress li::before {
    position: absolute;
    top: 16px;
    right: 50%;
    z-index: 0;
    width: 100%;
    height: 2px;
    content: "";
    background: var(--line);
}

.progress li:first-child::before {
    display: none;
}

.progress li span {
    position: relative;
    z-index: 1;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--ink-700);
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 50%;
    font-weight: 800;
}

.progress li.is-current,
.progress li.is-complete {
    color: var(--green-800);
    font-weight: 800;
}

.progress li.is-current span,
.progress li.is-complete span {
    color: #ffffff;
    background: var(--green-800);
    border-color: var(--green-800);
}

.progress li.is-complete::before,
.progress li.is-current::before {
    background: var(--green-700);
}

.form-page,
.termination-card {
    padding: 38px;
}

.form-page.is-active {
    animation: page-in 220ms ease-out;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading .step-label {
    color: var(--green-700);
}

.page-heading > p:last-child {
    max-width: 72ch;
    margin: 9px 0 0;
    color: var(--ink-700);
}

.information-card {
    padding: 24px;
    background: var(--green-50);
    border: 1px solid #cde3d6;
    border-left: 5px solid var(--green-700);
    border-radius: var(--radius-md);
}

.information-card p {
    margin: 0;
}

.information-card p + p {
    margin-top: 16px;
}

.question-card {
    min-width: 0;
    margin: 0 0 22px;
    padding: 22px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

fieldset.question-card {
    display: block;
}

.question-card > legend,
.field-question > label {
    width: 100%;
    margin: 0 0 17px;
    padding: 0;
    color: var(--ink-900);
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.45;
}

.question-number {
    display: inline-grid;
    width: 29px;
    height: 29px;
    margin-right: 7px;
    place-items: center;
    color: #ffffff;
    background: var(--green-800);
    border-radius: 50%;
    font-size: 0.88rem;
    vertical-align: middle;
}

.option-grid {
    display: grid;
    gap: 12px;
}

.option-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-stack {
    display: grid;
    gap: 10px;
}

.choice-card,
.check-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    cursor: pointer;
    background: #ffffff;
    border: 1.5px solid #c9d5cd;
    border-radius: var(--radius-md);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease,
        transform 150ms ease,
        opacity 150ms ease;
}

.choice-card:hover,
.check-card:hover {
    border-color: var(--green-700);
    transform: translateY(-1px);
}

.choice-card.is-selected,
.check-card.is-selected {
    background: var(--green-100);
    border-color: var(--green-700);
    box-shadow: 0 0 0 1px var(--green-700);
}

.choice-card.is-disabled,
.check-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.choice-card input[type="radio"],
.check-card input[type="checkbox"] {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    margin: 0;
    accent-color: var(--green-700);
    cursor: pointer;
}

.choice-card input:focus-visible,
.check-card input:focus-visible {
    outline: 3px solid rgba(12, 111, 215, 0.38);
    outline-offset: 3px;
}

.choice-copy,
.check-text {
    min-width: 0;
}

.choice-copy strong,
.choice-copy small {
    display: block;
}

.choice-copy small {
    margin-top: 2px;
    color: var(--ink-500);
    font-weight: 400;
    line-height: 1.35;
}

.choice-card-compact {
    min-height: 50px;
    padding: 12px 14px;
}

.declaration-card {
    margin-top: 22px;
    font-weight: 800;
}

.conditional-group {
    min-width: 0;
    margin: 20px 0 0;
    padding: 18px;
    background: #ffffff;
    border: 1px dashed #afbeb4;
    border-radius: var(--radius-md);
    transition:
        opacity 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.conditional-group > legend {
    padding: 0 7px;
    font-weight: 800;
}

.conditional-group.is-disabled {
    opacity: 0.62;
    background: #f3f6f4;
    border-color: #c5d0c9;
}

.conditional-group.is-disabled .choice-card {
    cursor: not-allowed;
    background: #f8faf9;
    border-color: #d4ddd7;
    transform: none;
}
.conditional-group.is-disabled .choice-card:hover {
    border-color: #d4ddd7;
    transform: none;
}
.conditional-group.is-disabled input {
    cursor: not-allowed;
}

.conditional-field {
    margin-top: 16px;
    padding: 16px;
    background: var(--green-50);
    border-left: 4px solid var(--green-700);
    border-radius: var(--radius-sm);
}

.conditional-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    color: var(--ink-900);
    background: #ffffff;
    border: 1.5px solid #adbbb2;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    min-height: 49px;
    padding: 11px 13px;
}

textarea {
    min-height: 170px;
    padding: 13px;
    line-height: 1.5;
    resize: vertical;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(12, 111, 215, 0.18);
}

input:disabled,
textarea:disabled {
    cursor: not-allowed;
    color: var(--ink-500);
    background: #eef2ef;
}

.field-help,
.character-counter {
    margin: 7px 0 0;
    color: var(--ink-500);
    font-size: 0.85rem;
}

.consent-help {
    margin: -4px 0 14px;
}

.character-counter {
    text-align: right;
}

.validation-message {
    margin: 0 0 18px;
    padding: 13px 15px;
    color: #7d1d19;
    background: var(--danger-bg);
    border: 1px solid #edc2bf;
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.actions-end {
    justify-content: flex-end;
}

.btn {
    min-height: 48px;
    padding: 11px 22px;
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    transition:
        background 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease,
        opacity 150ms ease;
}

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

.btn:focus-visible {
    outline: 3px solid rgba(12, 111, 215, 0.4);
    outline-offset: 3px;
}

.btn-primary {
    color: #ffffff;
    background: var(--green-800);
    box-shadow: 0 6px 18px rgba(11, 93, 53, 0.2);
}

.btn-primary:not(:disabled):hover {
    background: var(--green-950);
}

.btn-secondary {
    color: var(--green-950);
    background: var(--green-100);
}

.btn-secondary:not(:disabled):hover {
    background: #d6ebdf;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    box-shadow: none;
}

.btn.is-loading {
    cursor: progress;
}

.app-dialog {
    width: min(calc(100% - 32px), 590px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    color: var(--ink-900);
    background: #ffffff;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.app-dialog::backdrop {
    background: rgba(3, 25, 14, 0.72);
    backdrop-filter: blur(3px);
}

.dialog-content {
    padding: 30px;
}

.dialog-content h2 {
    font-size: 1.4rem;
}

.dialog-content p {
    margin: 12px 0 0;
    color: var(--ink-700);
}

.dialog-content .actions {
    margin-top: 24px;
}

.dialog-icon,
.status-icon {
    display: grid;
    width: 46px;
    height: 46px;
    margin-bottom: 17px;
    place-items: center;
    color: #ffffff;
    background: var(--warning);
    border-radius: 50%;
    font-size: 1.45rem;
    font-weight: 900;
}

.termination-card {
    text-align: center;
}

.termination-card .status-icon {
    margin-right: auto;
    margin-left: auto;
    background: var(--green-800);
}

.termination-card p {
    max-width: 68ch;
    margin: 14px auto 0;
    color: var(--ink-700);
}

.success-card {
    padding-top: 52px;
    padding-bottom: 52px;
}

.success-card .status-icon {
    width: 54px;
    height: 54px;
    font-size: 1.6rem;
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {
    body {
        padding: 0;
        background: var(--surface);
    }

    .site-shell {
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .brand-header {
        gap: 15px;
        padding:
            max(20px, env(safe-area-inset-top))
            max(20px, env(safe-area-inset-right))
            20px
            max(20px, env(safe-area-inset-left));
    }

    .brand-logo {
        width: 92px;
        max-height: 58px;
    }

    .progress {
        padding: 17px 20px 15px;
    }

    .form-page,
    .termination-card {
        padding: 26px 20px calc(30px + env(safe-area-inset-bottom));
    }

    .option-grid-two,
    .option-grid-three {
        grid-template-columns: 1fr;
    }

    .question-card {
        padding: 18px;
    }

    .choice-card,
    .check-card {
        min-height: 54px;
    }

    textarea {
        min-height: 190px;
    }

    .actions {
        position: sticky;
        bottom: 0;
        z-index: 4;
        margin: 28px -20px calc(-30px - env(safe-area-inset-bottom));
        padding:
            15px
            max(20px, env(safe-area-inset-right))
            calc(15px + env(safe-area-inset-bottom))
            max(20px, env(safe-area-inset-left));
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -8px 24px rgba(6, 53, 31, 0.09);
        backdrop-filter: blur(8px);
    }

    .dialog-content .actions {
        position: static;
        margin: 24px 0 0;
        padding: 18px 0 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .app-dialog {
        max-height: calc(100dvh - 24px);
    }

    .dialog-content {
        padding: 24px 22px;
    }
}

@media (max-width: 440px) {
    .brand-header {
        align-items: flex-start;
    }

    .brand-logo {
        width: 76px;
    }

    .brand-header .eyebrow {
        display: none;
    }

    h1 {
        padding-top: 4px;
        font-size: 1.35rem;
    }

    .progress li small {
        font-size: 0.68rem;
    }

    .progress li span {
        width: 31px;
        height: 31px;
    }

    .progress li::before {
        top: 15px;
    }

    .information-card {
        padding: 19px;
    }

    .choice-card,
    .check-card {
        padding: 13px;
    }

    .actions .btn {
        flex: 1 1 0;
        padding-right: 13px;
        padding-left: 13px;
    }

    .question-number {
        width: 27px;
        height: 27px;
        margin-right: 5px;
        font-size: 0.82rem;
    }
}

@media (max-width: 360px) {
    .progress li small {
        display: none;
    }

    .progress li {
        gap: 0;
    }

    .actions {
        gap: 8px;
    }

    .btn {
        font-size: 0.94rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* =========================================================
   MODAL DE RISCO - IMPLEMENTAÇÃO PRÓPRIA
   =========================================================
   Não depende do elemento HTML <dialog>.
   Mantém comportamento consistente em desktop, Android,
   iPhone/iPad e navegadores WebView.
========================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;

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

    width: 100%;
    min-width: 100%;
    height: 100vh;
    height: 100dvh;

    padding:
        max(20px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));

    background: rgba(3, 25, 14, 0.76);

    overflow-x: hidden;
    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-box {
    position: relative;
    z-index: 1;

    width: min(100%, 590px);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);

    margin: auto;
    padding: 30px;

    overflow-x: hidden;
    overflow-y: auto;

    color: var(--ink-900);
    background: #ffffff;

    border: 1px solid rgba(6, 53, 31, 0.12);
    border-radius: 18px;

    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);

    -webkit-overflow-scrolling: touch;
}

.modal-box h2 {
    margin: 0;
    color: var(--green-950);
    font-size: 1.4rem;
    line-height: 1.25;
}

.modal-box p {
    margin: 12px 0 0;
    color: var(--ink-700);
    line-height: 1.55;
}

.modal-actions {
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;

    margin: 24px 0 0 !important;
    padding: 18px 0 0 !important;

    background: transparent !important;
    border-top: 1px solid var(--line);

    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
}

@media (max-width: 720px) {
    .modal-overlay {
        align-items: center;

        padding:
            max(14px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(14px, env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));
    }

    .modal-box {
        width: 100%;
        max-height: calc(100vh - 28px);
        max-height: calc(100dvh - 28px);
        padding: 24px 22px;
        border-radius: 16px;
    }

    .modal-actions .btn {
        width: 100%;
        flex: 1 1 auto;
    }
}

@media (max-width: 440px) {
    .modal-box {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .modal-box h2 {
        font-size: 1.3rem;
    }
}


/* =========================================================
   VALIDAÇÃO VISUAL DE CAMPOS DE DIGITAÇÃO
========================================================= */

input.field-error,
textarea.field-error {
    border-color: var(--danger) !important;
    background: var(--danger-bg) !important;
    box-shadow: 0 0 0 3px rgba(161, 38, 34, 0.10) !important;
}

input.field-error:focus,
textarea.field-error:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(161, 38, 34, 0.18) !important;
}

.inline-error {
    position: relative;
    margin: 8px 0 0;
    padding-left: 22px;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
}

.inline-error::before {
    position: absolute;
    top: 1px;
    left: 0;
    display: inline-grid;
    width: 16px;
    height: 16px;
    place-items: center;
    content: "!";
    color: #ffffff;
    background: var(--danger);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
}

.inline-error[hidden] {
    display: none !important;
}

.conditional-field:has(.field-error) {
    background: #fff7f6;
    border-left-color: var(--danger);
}

@media (max-width: 720px) {
    .inline-error {
        font-size: 0.84rem;
    }
}
/* =========================================================
   RESUMO DINÂMICO DE PENDÊNCIAS
========================================================= */

.requirements-status {
    margin: 24px 0 -8px;
    padding: 14px 16px;

    color: #6f4512;
    background: var(--warning-bg);

    border: 1px solid #ead2a8;
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-sm);

    font-size: 0.9rem;
    line-height: 1.45;
}

.requirements-status.is-complete {
    color: var(--green-950);
    background: var(--green-50);

    border-color: #cde3d6;
    border-left-color: var(--green-700);
}

.requirements-title {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    font-weight: 800;
}

.requirements-icon {
    display: inline-grid;
    flex: 0 0 auto;

    width: 20px;
    height: 20px;

    margin-top: 1px;

    place-items: center;

    color: #ffffff;
    background: var(--warning);

    border-radius: 50%;

    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1;
}

.requirements-status.is-complete .requirements-icon {
    background: var(--green-700);
}

.requirements-status ul {
    margin: 9px 0 0 29px;
    padding: 0;
}

.requirements-status li + li {
    margin-top: 5px;
}

@media (max-width: 720px) {
    .requirements-status {
        margin-top: 20px;
        margin-bottom: -6px;
        padding: 13px 14px;
        font-size: 0.88rem;
    }
}
