:root {
  font: var(--weight-body) 16px/var(--leading-body) var(--font-text);
  color: var(--ink);
  color-scheme: light;
  background: #f3f6fa;
  --error-ink: #993527;
  --page-width: 1176px;
  --gutter: clamp(18px, 4vw, 54px);
}
.embedded, .embedded body { background: transparent; min-height: 0; }
.embedded .masthead, .embedded .cover, .embedded .alternative, .embedded .back-home { display: none; }
.embedded .booking, .embedded .sent .booking { display: block; max-width: none; padding: 0; margin: 0; }
.embedded .paper { padding: 5px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.embedded .paper h2 { font-size: clamp(1.28rem,4vw,1.65rem); margin-bottom: 16px; }
.embedded .visit { padding: 0; }
.embedded .contact-fields { margin-top: 24px; padding-top: 24px; }
.embedded #received { padding-block: 20px; }
.send-another { margin-top: 28px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p, dl, dd, fieldset { margin: 0; }
fieldset, legend { min-width: 0; padding: 0; border: 0; }
button, select, input { font: inherit; }
a { color: var(--blue-ink); font-weight: 600; text-decoration: none; }
button, a, .sedes label, .check { touch-action: manipulation; }
a, button, select, .sedes label, .check { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 3px; }
.masthead { background: var(--paper); border-bottom: 1px solid #dce4eb; }
.masthead-inner, .booking { max-width: calc(var(--page-width) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 14px; }
.practice { font-size: 1.28rem; font-weight: 600; color: var(--navy); letter-spacing: -.048em; }
.return { display: inline-flex; align-items: center; min-height: 44px; font-size: .88rem; color: var(--muted); }
.booking { display: grid; gap: 24px; padding-block: 26px max(32px, env(safe-area-inset-bottom)); }
.cover, .paper { min-width: 0; }
h1, h2 { color: var(--navy); font-weight: var(--weight-strong); line-height: 1.09; letter-spacing: -.05em; }
.cover h1 { font-size: clamp(2.2rem, 7.3vw, 3.5rem); }
em { font: italic 400 1.06em/.99 var(--font-accent); color: var(--blue-ink); }
.intro { max-width: 38ch; color: var(--muted); margin-top: 12px; text-wrap: pretty; }
.office { position: relative; isolation: isolate; overflow: hidden; background: var(--navy); color: white; border-radius: var(--radius-panel); margin-top: 18px; }
.office-photo { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#08234a 2%,#08234af7 38%,#08234aa6 60%,transparent 100%), url('/consultorio.webp') center 66% / cover; }
.office-hours { padding: 12px 16px; }
.office-hours span { color: #c5e8fa; font-size: .75rem; }
.office-hours p { line-height: 1.35; font-weight: 600; font-size: .91rem; margin-top: 2px; }
.office-hours b { display: block; font-weight: 500; }
.paper { background: var(--paper); border: 1px solid #dce4eb; border-radius: var(--radius-section); padding: clamp(18px, 4vw, 40px); box-shadow: 0 7px 28px -18px #08234a35; }
.paper h2 { font-size: clamp(1.45rem, 2.1vw, 1.85rem); margin-bottom: 18px; }
.locations { margin-bottom: 20px; }
.field > label { font-weight: 600; font-size: .9rem; line-height: 1.3; color: var(--navy); }
.sedes, .fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.sedes { gap: 10px; }
.sedes label {
  display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: flex-start;
  padding: 14px; gap: 8px; border: 1px solid #a3b7c9; border-radius: var(--radius-panel); background: white;
}
.sedes input { flex: none; margin: 2px 0 0; width: 17px; height: 17px; accent-color: var(--blue-ink); }
.sedes span { min-width: 0; color: var(--navy); font-weight: 600; line-height: 1.3; }
.sedes small { display: block; margin-top: 4px; font-size: .8rem; font-weight: 400; color: var(--muted); }
.sedes label:has(:checked) { background: var(--mist); border-color: var(--blue-ink); box-shadow: inset 0 0 0 1px var(--blue-ink); }
.sedes label:has(:focus-visible) { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.sedes input:focus-visible { outline: none; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field input, .field select { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; color: var(--navy); background-color: white; border: 1px solid #a5b8c9; border-radius: calc(var(--radius-control) + 2px); font-size: 1rem; line-height: 1.35; }
.field input::placeholder, .field select:has(option:checked[value=""]) { color: #52677b; }
.field input:focus, .field select:focus { border-color: var(--blue-ink); outline: 2px solid var(--blue-ink); outline-offset: 1px; }
.field select { padding-right: 30px; }
.contact-fields { margin-top: 23px; padding-top: 22px; border-top: 1px solid var(--line); }
.phone { grid-column: 1/-1; }
.fine, .alternative { font-size: .82rem; line-height: 1.45; color: var(--muted); }
.consent { margin-block: 14px; }
.check { display: flex; align-items: flex-start; min-height: 44px; gap: 10px; padding-block: 6px; font-size: .87rem; line-height: 1.5; color: var(--muted); }
.check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue-ink); }
.field-error, .error { color: var(--error-ink); font-size: .84rem; }
.field-error { display: block; }
.locations > .field-error { margin-top: 6px; }
.error:not(:empty) { margin-bottom: 12px; padding: 10px 12px; background: #fff2ef; border-radius: var(--radius-control); }
.field [aria-invalid="true"], .sedes label:has([aria-invalid="true"]) { border-color: var(--error-ink); }
.check input[aria-invalid="true"] { outline: 1px solid var(--error-ink); }
.submit, .back-home { display: grid; place-items: center; width: 100%; min-height: 48px; padding: 11px 16px; border: 0; border-radius: var(--radius-panel); background: var(--action-blue); color: var(--action-ink); font-size: 1rem; font-weight: 600; text-align: center; }
.submit:not(:disabled):active { background: var(--sky); }
.submit:disabled { cursor: progress; background: var(--mist); }
.alternative { text-align: center; margin-top: 8px; }
.alternative a { display: inline-flex; align-items: center; min-height: 42px; }
#received h2 { font-size: clamp(2.1rem, 4vw, 3.45rem); }
#received > p:not(.alternative) { max-width: 46ch; color: var(--muted); }
#patient-first { overflow-wrap: anywhere; }
.sent .cover { display: none; }
.sent .booking { display: block; max-width: 720px; }
@media (min-width: 800px) {
  .masthead-inner { min-height: 72px; }
  .booking { grid-template-columns: minmax(0, .77fr) minmax(0, 1.23fr); align-items: start; gap: clamp(44px, 6.4vw, 94px); padding-block: clamp(34px, 4vw, 64px); }
  .cover { padding-top: 14px; }
  .cover h1 { font-size: clamp(3.6rem, 5.05vw, 4.9rem); }
  .cover h1 em { display: block; }
  .intro { font-size: var(--type-lead); margin-top: 18px; }
  .office { border-radius: var(--radius-section); margin-top: 32px; }
  .office-photo { position: static; height: clamp(160px,17vw,245px); background: url('/consultorio.webp') 54% 62% / cover; }
  .office-hours { padding: 17px 21px 20px; }
  .office-hours p { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: .97rem; }
  .sedes label { gap: 9px; padding: 14px; }
  .sedes span { font-size: 1.04rem; }
}
@media (min-width: 550px) and (max-width: 799px) { .booking { max-width: 680px; } }
@media (max-width: 549px) {
  body { min-height: 100svh; background: var(--paper); }
  .masthead-inner { min-height: 54px; }
  .paper { padding: 22px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .sent .paper { border: 0; }
}
@media (max-width: 395px) {
  .sedes label { padding: 11px 9px; gap: 6px; }
  .sedes span { font-size: .94rem; }
}
@media (max-width: 315px) {
  .sedes { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sedes label { align-items: center; padding: 10px 12px; }
  .sedes small { margin-top: 2px; }
  .fields { column-gap: 10px; }
}
@media (hover:hover) {
  a:hover { color: var(--navy); }
  .sedes label:hover { border-color: var(--blue-ink); }
  .submit:not(:disabled):hover, .back-home:hover { background: #38b4f4; color: var(--action-ink); }
}
@media (prefers-reduced-motion:no-preference) {
  .sedes label, .submit, .back-home { transition: background-color var(--motion-fast), border-color var(--motion-fast); }
  #received:not([hidden]) { animation: received .22s var(--ease-out); }
  @keyframes received { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
