:root {
    --ink: #172821;
    --muted: #697871;
    --green: #163f32;
    --green-2: #225d49;
    --lime: #dfff5b;
    --lime-soft: #f2ffc2;
    --cream: #f7f6ef;
    --paper: #fffefa;
    --line: #dfe4dd;
    --danger: #ba3b3b;
    --shadow: 0 24px 70px rgba(23, 40, 33, .11);
    --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }

a { color: inherit; text-decoration: none; }

button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
    height: 76px;
    padding: 0 clamp(24px, 5vw, 80px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 20;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-family: Manrope, sans-serif;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -.6px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--lime);
    transform: rotate(-5deg);
}

.brand-accent { color: var(--green-2); }

.panel-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--green);
    font-size: 14px;
    font-weight: 700;
}

.panel-link svg, .view-response svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}

.panel-link:hover svg:not(.arrow-back), .view-response:hover svg { transform: translateX(3px); }
.panel-link:hover .arrow-back { transform: translateX(-3px); }

.hero {
    min-height: 420px;
    padding: 74px max(24px, calc((100% - 1180px) / 2));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    color: white;
    background:
        radial-gradient(circle at 83% 12%, rgba(223, 255, 91, .14), transparent 25%),
        linear-gradient(120deg, #102f26 0%, #194839 100%);
    position: relative;
    overflow: hidden;
}

.hero::before, .hero::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(223, 255, 91, .14);
    border-radius: 50%;
}

.hero::before { width: 440px; height: 440px; right: -120px; top: -250px; }
.hero::after { width: 280px; height: 280px; right: -55px; top: -170px; }

.hero-copy { max-width: 700px; position: relative; z-index: 1; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--green-2);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.hero .eyebrow, .success-modal .eyebrow { color: var(--lime); }
.eyebrow > span { width: 18px; height: 2px; background: currentColor; }

.hero h1, .dashboard-header h1 {
    margin: 17px 0 20px;
    font: 800 clamp(46px, 6vw, 74px)/.98 Manrope, sans-serif;
    letter-spacing: -4px;
}

.hero h1 em, .dashboard-header h1 em {
    color: var(--lime);
    font-family: Georgia, serif;
    font-weight: 400;
}

.hero-copy > p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, .69);
    font-size: 18px;
    line-height: 1.65;
}

.hero-note {
    width: 300px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 16px;
    background: rgba(255,255,255,.07);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.note-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--lime);
    border-radius: 12px;
}

.hero-note strong, .hero-note small { display: block; }
.hero-note strong { font-size: 13px; margin-bottom: 4px; }
.hero-note small { color: rgba(255,255,255,.58); font-size: 12px; }

.form-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 72px 24px 110px;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 66px;
    align-items: start;
}

.form-sidebar { position: sticky; top: 28px; }

.progress-card {
    padding: 18px;
    background: var(--green);
    color: white;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(22, 63, 50, .16);
}

.progress-heading { display: flex; justify-content: space-between; font-size: 12px; }
.progress-heading span { color: rgba(255,255,255,.65); }
.progress-heading strong { color: var(--lime); }
.progress-track { height: 5px; margin: 13px 0 10px; background: rgba(255,255,255,.13); border-radius: 10px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--lime); border-radius: inherit; transition: width .3s ease; }
.progress-card small { color: rgba(255,255,255,.48); font-size: 10px; }

.section-nav { margin-top: 22px; display: grid; gap: 1px; }
.section-nav a {
    min-height: 38px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #7e8a84;
    font-size: 12px;
    font-weight: 600;
    border-left: 2px solid var(--line);
    transition: .2s ease;
}
.section-nav a span { color: #a3aca8; font: 700 9px Manrope, sans-serif; }
.section-nav a:hover, .section-nav a.active { color: var(--green); border-left-color: var(--green); background: rgba(22,63,50,.035); }
.section-nav a.complete span { color: var(--green-2); }

.questionnaire { min-width: 0; }
.form-section { scroll-margin-top: 24px; margin-bottom: 64px; }

.section-header {
    display: flex;
    gap: 19px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.section-number {
    width: 49px;
    height: 49px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--lime);
    border-radius: 14px;
    font: 800 13px Manrope, sans-serif;
}

.section-header h2, .submit-card h2 {
    margin: 1px 0 6px;
    font: 800 25px Manrope, sans-serif;
    letter-spacing: -1px;
}
.section-header p, .submit-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.fields {
    padding: 34px 38px 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 35px rgba(23, 40, 33, .035);
}

.field { margin-bottom: 30px; }
.field label { margin-bottom: 11px; display: flex; align-items: flex-start; gap: 11px; font-weight: 700; font-size: 14px; line-height: 1.5; }
.field label b { margin-left: 4px; color: #b67737; }
.field-index { color: #9ca7a2; font: 700 9px/21px Manrope, sans-serif; }

textarea {
    width: 100%;
    min-height: 54px;
    padding: 16px 17px;
    resize: vertical;
    color: var(--ink);
    background: #fbfbf7;
    border: 1px solid #d9dfd8;
    border-radius: 11px;
    outline: 0;
    font-size: 14px;
    line-height: 1.55;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea::placeholder { color: #a5aea9; }
textarea:hover { border-color: #b8c3bd; }
textarea:focus { background: white; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(34, 93, 73, .1); }
textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(186,59,59,.08); }
.field-error { display: block; min-height: 0; margin-top: 6px; color: var(--danger); font-size: 11px; }

.honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

.submit-card {
    padding: 34px 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background: var(--lime-soft);
    border: 1px solid #d8ed8d;
    border-radius: var(--radius);
}

.submit-card .eyebrow { margin-bottom: 8px; }
.primary-button, .secondary-button {
    min-height: 48px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    border-radius: 11px;
    font-weight: 800;
    font-size: 13px;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.primary-button { color: white; background: var(--green); border: 1px solid var(--green); box-shadow: 0 10px 24px rgba(22,63,50,.18); }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(22,63,50,.25); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.secondary-button { color: var(--green); background: transparent; border: 1px solid #b9c5bf; }
.secondary-button:hover { background: rgba(22,63,50,.05); }
.form-status { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 13px; text-align: right; }

.success-overlay, .drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 25, 20, .68);
    backdrop-filter: blur(8px);
}
[hidden] { display: none !important; }

.success-modal {
    width: min(520px, 100%);
    padding: 48px;
    text-align: center;
    color: white;
    background: var(--green);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 26px;
    box-shadow: var(--shadow);
}
.success-icon { width: 62px; height: 62px; margin: 0 auto 25px; display: grid; place-items: center; color: var(--green); background: var(--lime); border-radius: 50%; font-size: 28px; font-weight: 800; }
.success-modal h2 { margin: 12px 0; font: 800 35px Manrope, sans-serif; letter-spacing: -1.6px; }
.success-modal p { margin: 0 auto 30px; max-width: 390px; color: rgba(255,255,255,.65); font-size: 14px; line-height: 1.65; }
.success-actions { display: flex; justify-content: center; gap: 10px; }
.success-modal .primary-button { color: var(--green); background: var(--lime); border-color: var(--lime); }
.success-modal .secondary-button { color: white; border-color: rgba(255,255,255,.3); }

/* Painel */
.panel-page { min-height: 100vh; background: #f4f4ed; }
.dashboard { max-width: 1240px; margin: 0 auto; padding: 66px 28px 100px; }
.dashboard-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 42px; }
.dashboard-header h1 { margin: 12px 0 10px; color: var(--green); font-size: clamp(40px, 5vw, 60px); }
.dashboard-header h1 em { color: var(--green-2); }
.dashboard-header p { margin: 0; color: var(--muted); }
.export-button svg { width: 17px; }
.export-button.disabled { opacity: .45; pointer-events: none; }

.metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 17px; margin-bottom: 24px; }
.metric-card { min-height: 154px; padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; }
.metric-card.featured { color: white; background: var(--green); border-color: var(--green); }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.metric-card.featured > span, .metric-card.featured small { color: rgba(255,255,255,.55); }
.metric-card strong { margin: 7px 0 2px; color: var(--green); font: 800 35px Manrope, sans-serif; letter-spacing: -1.5px; }
.metric-card.featured strong { color: var(--lime); }
.metric-card strong.metric-date { font-size: 23px; letter-spacing: -.8px; }
.metric-card small { color: #939e98; font-size: 11px; }

.responses-panel { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 19px; }
.responses-toolbar { padding: 24px 27px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.responses-toolbar h2 { margin: 0 0 3px; font: 800 18px Manrope, sans-serif; letter-spacing: -.5px; }
.responses-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.search-box { width: min(320px, 100%); height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 9px; background: #f7f7f1; border: 1px solid var(--line); border-radius: 10px; }
.search-box svg { width: 17px; flex: 0 0 auto; fill: none; stroke: #7f8c85; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }

.response-row { min-height: 96px; padding: 18px 27px; display: grid; grid-template-columns: 46px minmax(0, 1fr) 155px 125px; gap: 17px; align-items: center; border-bottom: 1px solid #e8ebe6; }
.response-row:last-child { border-bottom: 0; }
.response-row:hover { background: #fbfcf7; }
.response-avatar { width: 43px; height: 43px; display: grid; place-items: center; color: var(--green); background: var(--lime-soft); border-radius: 12px; font: 800 15px Manrope, sans-serif; }
.response-main { min-width: 0; }
.response-main h3 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px Manrope, sans-serif; }
.response-main p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.response-row time { color: #78857e; font-size: 11px; }
.view-response { padding: 8px 0; display: inline-flex; justify-content: flex-end; align-items: center; gap: 7px; color: var(--green-2); background: transparent; border: 0; cursor: pointer; font-size: 11px; font-weight: 800; }
.view-response svg { width: 16px; }

.empty-state { padding: 75px 24px; text-align: center; }
.empty-state > span { width: 52px; height: 52px; margin: 0 auto 18px; display: grid; place-items: center; color: var(--green); background: var(--lime-soft); border-radius: 15px; font-size: 20px; }
.empty-state h3 { margin: 0 0 8px; font: 800 18px Manrope, sans-serif; }
.empty-state p { margin: 0 auto 22px; max-width: 400px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.alert { margin-bottom: 20px; padding: 14px 18px; border-radius: 10px; font-size: 13px; }
.alert.error { color: #792727; background: #ffe8e8; border: 1px solid #f4c3c3; }

.drawer-overlay { z-index: 90; display: block; padding: 0; }
.response-drawer { width: min(690px, 94vw); height: 100vh; position: fixed; top: 0; right: 0; z-index: 110; display: flex; flex-direction: column; background: var(--paper); box-shadow: -20px 0 70px rgba(10,25,20,.2); transform: translateX(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.response-drawer.open { transform: translateX(0); }
.drawer-header { min-height: 110px; padding: 24px 31px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { max-width: 540px; margin: 6px 0 0; font: 800 23px Manrope, sans-serif; letter-spacing: -1px; }
.drawer-close { width: 40px; height: 40px; flex: 0 0 auto; cursor: pointer; color: var(--green); background: #f0f2ec; border: 0; border-radius: 10px; font-size: 27px; font-weight: 300; line-height: 1; }
.drawer-content { padding: 8px 31px 50px; overflow-y: auto; }
.drawer-meta { margin: 18px 0 25px; color: var(--muted); font-size: 11px; }
.drawer-section { padding: 25px 0; border-top: 1px solid var(--line); }
.drawer-section:first-of-type { border-top: 0; }
.drawer-section h3 { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; font: 800 14px Manrope, sans-serif; }
.drawer-section h3 span { width: 26px; height: 26px; display: grid; place-items: center; color: var(--green); background: var(--lime-soft); border-radius: 7px; font-size: 9px; }
.answer { margin-bottom: 19px; }
.answer:last-child { margin-bottom: 0; }
.answer dt { margin-bottom: 6px; color: #829089; font-size: 10px; font-weight: 700; }
.answer dd { margin: 0; color: #263a32; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.answer dd.empty { color: #a1aaa5; font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.drawer-open { overflow: hidden; }

@media (max-width: 900px) {
    .hero { min-height: 390px; padding-top: 58px; padding-bottom: 58px; align-items: center; }
    .hero-note { display: none; }
    .form-layout { grid-template-columns: 1fr; gap: 35px; }
    .form-sidebar { position: static; }
    .section-nav { display: none; }
    .progress-card { position: sticky; top: 10px; z-index: 10; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .metric-card:last-child { grid-column: span 2; }
    .response-row { grid-template-columns: 46px minmax(0, 1fr) 120px; }
    .response-row time { display: none; }
}

@media (max-width: 620px) {
    .topbar { height: 66px; padding: 0 18px; }
    .brand { font-size: 17px; }
    .brand-mark { width: 32px; height: 32px; }
    .panel-link span { display: none; }
    .hero { min-height: 350px; padding: 48px 22px; }
    .hero h1, .dashboard-header h1 { font-size: 43px; letter-spacing: -2.8px; }
    .hero-copy > p { font-size: 15px; }
    .form-layout { padding: 42px 16px 75px; }
    .form-section { margin-bottom: 45px; }
    .section-header { gap: 13px; }
    .section-number { width: 43px; height: 43px; border-radius: 12px; }
    .section-header h2 { font-size: 21px; }
    .fields { padding: 25px 19px 2px; border-radius: 17px; }
    .field label { font-size: 13px; }
    .submit-card { padding: 27px 22px; align-items: stretch; flex-direction: column; }
    .submit-card .primary-button { width: 100%; }
    .success-modal { padding: 38px 22px; }
    .success-actions { flex-direction: column; }
    .dashboard { padding: 45px 16px 70px; }
    .dashboard-header { align-items: stretch; flex-direction: column; }
    .dashboard-header .export-button { align-self: flex-start; }
    .metrics { grid-template-columns: 1fr; }
    .metric-card:last-child { grid-column: auto; }
    .metric-card { min-height: 125px; }
    .responses-toolbar { align-items: stretch; flex-direction: column; }
    .search-box { width: 100%; }
    .response-row { padding: 18px; grid-template-columns: 42px minmax(0,1fr); gap: 12px; }
    .response-avatar { width: 40px; height: 40px; }
    .view-response { grid-column: 2; justify-content: flex-start; }
    .drawer-header, .drawer-content { padding-left: 21px; padding-right: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
