@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #111111;
  --muted: #707070;
  --line: #e7e7e7;
  --soft: #f5f5f5;
  --white: #ffffff;
  --danger: #a52323;
  --success: #176b43;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fafafa; color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #a9a9a9; outline-offset: 2px; }
.app-shell, .public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar, .public-header {
  height: 68px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1080px) / 2)); background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.035em; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; }
.demo-badge, .count-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--soft); padding: 5px 10px; color: #555; font-size: 11px; font-weight: 600; white-space: nowrap; }
.topbar-link, .back-link { font-size: 13px; color: #555; font-weight: 600; }
.page { width: min(100% - 40px, 960px); margin: 42px auto 56px; flex: 1; }
.narrow-page { width: min(100% - 40px, 700px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; font-size: 10px; font-weight: 700; letter-spacing: .13em; color: #777; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.055em; line-height: 1.13; font-weight: 700; }
h2 { font-size: 17px; letter-spacing: -.025em; margin-bottom: 0; }
h3 { font-size: 15px; margin-bottom: 5px; }
.muted { color: var(--muted); }
.page-heading .muted, .form-intro .muted { margin-bottom: 0; max-width: 560px; font-size: 14px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 46px; border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; transition: background .15s ease, border-color .15s ease; }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover { background: #303030; }
.button-outline { background: white; color: var(--ink); border-color: #dcdcdc; }
.button-outline:hover { background: #f7f7f7; }
.full-width { width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 38px; }
.stat-card { padding: 20px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.stat-card strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.stat-card .stat-date { font-size: 18px; padding-top: 5px; }
.list-section { margin-bottom: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search-field { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: white; border: 1px solid var(--line); border-radius: 11px; color: #777; margin-bottom: 14px; }
.search-field > span { font-size: 22px; line-height: 1; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.response-list, .question-list { display: grid; gap: 10px; }
.response-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); background: white; border-radius: 12px; transition: border-color .15s ease, transform .15s ease; }
.response-card:hover { border-color: #bcbcbc; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #f0f0f0; color: #333; font-weight: 700; flex-shrink: 0; }
.response-info { flex: 1; min-width: 0; }
.response-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.response-info span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.response-arrow { color: #777; font-size: 20px; padding-left: 4px; }
.empty-state { text-align: center; background: white; border: 1px dashed #d7d7d7; border-radius: var(--radius); padding: 36px 18px; }
.empty-state p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.empty-icon { font-size: 32px; color: #aaa; margin-bottom: 8px; }
.text-link { display: inline-block; color: #111; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.quick-actions { display: flex; align-items: center; justify-content: space-between; gap: 22px; border-top: 1px solid var(--line); padding: 24px 0; }
.quick-actions p { font-size: 13px; margin: 5px 0 0; }
.action-row { display: flex; gap: 9px; flex-wrap: wrap; }
.demo-notice { margin: 24px 0 0; padding: 13px 15px; border-radius: 10px; background: #f1f1f1; color: #606060; font-size: 11px; line-height: 1.6; }
.footer { margin-top: auto; padding: 22px 20px; text-align: center; color: #888; font-size: 11px; border-top: 1px solid var(--line); background: #fff; }
.footer span { margin: 0 5px; }
.back-link { display: inline-block; margin-bottom: 30px; }
.answer-card { margin-top: 26px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.answer-person { padding: 20px; border-bottom: 1px solid var(--line); }
.answer-person h2 { margin-bottom: 8px; }
.detail-line { font-size: 13px; color: #666; margin-top: 4px; overflow-wrap: anywhere; }
.answer-item { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.answer-item:last-child { border-bottom: 0; }
.answer-question { font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.answer-value { display: inline-flex; border-radius: 7px; padding: 5px 10px; background: #f2f2f2; font-size: 12px; font-weight: 600; }
.page-actions { margin-top: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 20px; }
.form-stack { display: grid; gap: 12px; margin: 25px 0 28px; }
.field-label, .field label { font-size: 12px; font-weight: 600; }
textarea, input:not([type="checkbox"]):not([type="radio"]) { width: 100%; min-width: 0; border: 1px solid #dedede; background: #fff; border-radius: 10px; padding: 12px 13px; color: var(--ink); outline: 0; }
textarea { resize: vertical; }
textarea:focus, input:focus { border-color: #888; }
.check-row { display: flex; align-items: center; gap: 9px; color: #555; font-size: 12px; }
input[type="checkbox"], input[type="radio"] { accent-color: #111; width: 17px; height: 17px; }
.editor-list-heading { margin-top: 26px; }
.question-card { display: flex; align-items: flex-start; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.question-number { display: grid; place-items: center; width: 28px; height: 28px; background: var(--soft); border-radius: 8px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.question-copy { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; padding-top: 3px; }
.question-required { display: block; color: #777; font-size: 10px; font-weight: 400; margin-top: 5px; }
.question-tools { display: flex; gap: 4px; }
.icon-button { width: 36px; height: 36px; border: 1px solid #e5e5e5; background: white; border-radius: 8px; cursor: pointer; font-size: 15px; }
.icon-button:hover { background: var(--soft); }
.icon-button.danger { color: var(--danger); }
.share-panel { margin-top: 28px; display: grid; gap: 13px; }
.share-panel p { margin: 5px 0 0; font-size: 12px; }
.share-field { display: flex; gap: 8px; }
.share-field input { flex: 1; font-size: 12px; }
.small-status { min-height: 17px; color: var(--success); }
.sticky-save { position: sticky; bottom: 0; background: rgba(250,250,250,.94); padding: 12px 0; margin-top: 16px; backdrop-filter: blur(8px); }
.hidden { display: none !important; }
.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; }

.public-body { background: #f8f8f8; }
.public-header { padding-left: max(22px, calc((100vw - 720px) / 2)); padding-right: max(22px, calc((100vw - 720px) / 2)); }
.secure-label { display: flex; align-items: center; gap: 7px; color: #666; font-size: 11px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: #777; }
.public-main { width: min(100% - 36px, 680px); margin: 38px auto 60px; flex: 1; }
.form-intro { margin-bottom: 28px; }
.form-intro h1 { font-size: clamp(29px, 7vw, 38px); }
.patient-form { display: grid; gap: 15px; }
.form-section { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.form-section h2 { margin-bottom: 18px; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }
.field label span { color: var(--danger); }
.field input { min-height: 47px; }
.small-copy { font-size: 12px; margin: -8px 0 18px; }
.patient-questions { display: grid; gap: 12px; }
.patient-question { padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.patient-question-title { font-size: 13px; font-weight: 600; margin-bottom: 13px; }
.required-mark { color: var(--danger); }
.radio-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.radio-option { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1px solid #e1e1e1; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; }
.radio-option:has(input:checked) { background: #f1f1f1; border-color: #111; }
.radio-option input { width: 17px; height: 17px; margin: 0; }
.submit-button { min-height: 52px; font-size: 14px; }
.privacy-note { color: #777; font-size: 11px; text-align: center; margin: 0 10px; }
.form-error { margin: 0; color: var(--danger); font-size: 12px; background: #fff1f1; padding: 11px 13px; border-radius: 9px; }
.thankyou-shell { justify-content: space-between; }
.thankyou-card { width: min(100% - 36px, 440px); margin: auto; padding: 36px 28px; background: white; border: 1px solid var(--line); border-radius: 18px; text-align: center; box-shadow: var(--shadow); }
.success-mark { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 23px; background: #f0f0f0; font-size: 26px; font-weight: 600; }
.thankyou-card h1 { font-size: 28px; }
.thankyou-card .muted { font-size: 13px; margin: 13px 0 24px; }

@media (max-width: 640px) {
  .topbar, .public-header { height: 60px; padding-left: 18px; padding-right: 18px; }
  .page { width: calc(100% - 32px); margin: 28px auto 38px; }
  .narrow-page { width: calc(100% - 32px); }
  .page-heading { display: block; margin-bottom: 23px; }
  .desktop-action { display: none; }
  .stats-grid { gap: 9px; margin-bottom: 30px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 24px; }
  .stat-card .stat-date { font-size: 15px; }
  .quick-actions { display: block; }
  .quick-actions .action-row { display: grid; grid-template-columns: 1fr; margin-top: 16px; }
  .response-card { padding: 13px; gap: 11px; }
  .avatar { width: 38px; height: 38px; }
  .action-row { display: grid; grid-template-columns: 1fr; }
  .action-row .button { width: 100%; }
  .panel { padding: 16px; }
  .question-card { padding: 12px; gap: 8px; }
  .question-tools { flex-direction: column; }
  .icon-button { width: 34px; height: 34px; }
  .share-field { flex-direction: column; }
  .share-field .button { width: 100%; }
  .public-main { width: calc(100% - 28px); margin: 27px auto 38px; }
  .form-section { padding: 17px; }
  .patient-question { padding: 13px; }
  .thankyou-card { padding: 30px 22px; }
}
@media print {
  body { background: white; }
  .topbar, .footer, .back-link, .page-actions, .demo-notice { display: none !important; }
  .page { width: 100%; margin: 0; }
  .answer-card { border-color: #ccc; }
}


/* Comentário condicional exibido quando a resposta for "Sim" */
.comment-field { margin-top: 13px; padding: 13px; background: #fafafa; border: 1px solid #e7e7e7; border-radius: 10px; }
.comment-field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.comment-field textarea { display: block; width: 100%; min-height: 82px; resize: vertical; font-size: 13px; }
.answer-comment { margin-top: 12px; padding: 12px 14px; background: #f8f8f8; border-radius: 9px; font-size: 12px; }
.answer-comment p { margin: 5px 0 0; white-space: normal; overflow-wrap: anywhere; color: #555; }


/* Campos adicionais da ficha Satori */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.open-questions { display: grid; gap: 3px; }
.patient-question { min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: 15px; margin: 0 0 11px; }
.patient-question legend { padding: 0 4px; font-size: 13px; font-weight: 600; max-width: 100%; }
.check-options { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.check-option { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.check-option input { width: 17px; height: 17px; accent-color: #111; }
.consent-copy { color: #4f4f4f; font-size: 12px; line-height: 1.75; }
.consent-copy p { margin-bottom: 13px; }
.consent-check { align-items: flex-start; padding: 13px; margin: 14px 0; background: #f7f7f7; border-radius: 9px; line-height: 1.5; }
.consent-check input { flex-shrink: 0; margin-top: 2px; }
.consent-check .required-mark { color: var(--danger); }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .check-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .check-option { justify-content: flex-start; }
}

.answer-long-value { font-size: 13px; color: #555; white-space: normal; overflow-wrap: anywhere; }
