.agenda { margin: 42px 0 64px; padding: clamp(20px, 4vw, 40px); border: 1px solid #d9e5f4; border-radius: 20px; background: linear-gradient(155deg, #f5f9ff 0%, #fff 52%); box-shadow: 0 14px 34px rgba(23, 43, 69, .08); scroll-margin-top: 104px; }
.agenda__encabezado { max-width: 760px; margin: 0 auto 26px; text-align: center; }
.agenda__encabezado h2 { margin: 0; color: #172b45; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.18; }
.agenda__encabezado > p:last-child { margin: 12px auto 0; color: #40546c; line-height: 1.6; }
.agenda__progreso { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 760px; margin: 0 auto 28px; padding: 0; list-style: none; }
.agenda__progreso li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-bottom: 3px solid #c9d4e2; color: #52647a; font-weight: 700; }
.agenda__progreso li[aria-current="step"] { border-color: #0a58ff; color: #123d68; }
.agenda__progreso li > span:first-child { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #e4eaf2; font-variant-numeric: tabular-nums; }
.agenda__progreso li[aria-current="step"] > span:first-child { background: #0a58ff; color: #fff; }
.agenda__formulario { max-width: 900px; margin: 0 auto; }
.agenda__paso { min-width: 0; margin: 0; padding: 0; border: 0; }
.agenda__paso[hidden] { display: none; }
.agenda__paso legend { margin-bottom: 18px; color: #172b45; font-size: 1.22rem; font-weight: 800; }
.agenda__servicios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.agenda__servicio { min-height: 102px; padding: 16px; border: 1px solid #d8e1ed; border-radius: 13px; background: #fff; color: #172b45; text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.agenda__servicio:hover { border-color: #4781ff; box-shadow: 0 5px 18px rgba(10, 88, 255, .1); }
.agenda__servicio[aria-pressed="true"] { border: 2px solid #0a58ff; background: #eef5ff; box-shadow: 0 0 0 2px rgba(10, 88, 255, .08); }
.agenda__servicio strong, .agenda__servicio span { display: block; }
.agenda__servicio strong { margin-bottom: 7px; font-size: 1rem; }
.agenda__servicio span { color: #51637a; font-size: .92rem; line-height: 1.45; }
.agenda__campo { display: grid; gap: 7px; margin: 18px 0; }
.agenda__campo label, .agenda__etiqueta { color: #26384d; font-weight: 750; }
.agenda__campo input, .agenda__campo textarea, .agenda__campo select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #b7c6d8; border-radius: 9px; background: #fff; color: #172b45; font: inherit; }
.agenda__campo textarea { resize: vertical; }
.agenda__campo input:focus-visible, .agenda__campo textarea:focus-visible, .agenda__campo select:focus-visible, .agenda__servicio:focus-visible, .agenda__dia:focus-visible, .agenda__dia-pagina:focus-visible, .agenda__horario:focus-visible, .agenda__boton:focus-visible { outline: 3px solid #a94700; outline-offset: 2px; }
.agenda__campo [data-field-error]:empty { display: none; }
.agenda__campo [data-field-error]:not(:empty) { color: #7f1820; font-weight: 700; }
.agenda__campo--invalid > label, .agenda__campo--invalid .agenda__consentimiento { color: #7f1820; }
.agenda__campo--invalid input, .agenda__campo--invalid textarea { border: 2px solid #a51d24; color: #7f1820; }
.agenda__campo--invalid input:focus-visible, .agenda__campo--invalid textarea:focus-visible { outline-color: #7f1820; }
.agenda__campo--shake { animation: agendaFieldShake .28s ease-in-out; }
.agenda__error-summary { margin: 0 0 18px; padding: 14px 16px; border: 2px solid #a51d24; border-radius: 10px; background: #fff5f5; color: #7f1820; }
.agenda__error-summary[hidden] { display: none; }
.agenda__error-summary h3 { margin: 0 0 6px; color: #7f1820; font-size: 1rem; }
.agenda__error-summary ul { margin: 0; padding-left: 1.25rem; }
.agenda__error-summary a { color: #7f1820; font-weight: 700; text-underline-offset: 2px; }
.agenda__error-summary:focus-visible { outline: 3px solid #a94700; outline-offset: 3px; }
.agenda__campo small, .agenda__captcha p { color: #4c5e73; font-size: .9rem; line-height: 1.5; }
.agenda__horario-nota { margin: 0 0 18px; padding: 13px 15px; border-left: 4px solid #0a58ff; border-radius: 8px; background: #edf4ff; color: #26384d; line-height: 1.55; }
.agenda__dias-navegacion { display: grid; grid-template-columns: minmax(110px, auto) 1fr minmax(110px, auto); align-items: center; gap: 10px; }
.agenda__dia-pagina { min-height: 44px; padding: 8px 12px; border: 1px solid #bfd0e4; border-radius: 8px; background: #fff; color: #173c68; font: inherit; font-size: .92rem; font-weight: 750; cursor: pointer; }
.agenda__dia-pagina:last-child { justify-self: end; }
.agenda__dia-pagina:hover:not(:disabled) { border-color: #0a58ff; background: #f2f7ff; }
.agenda__dia-pagina:disabled { cursor: not-allowed; opacity: .5; }
.agenda__periodo { margin: 0; color: #51637a; font-size: .92rem; font-weight: 700; text-align: center; }
.agenda__dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.agenda__dia { display: grid; min-width: 0; min-height: 84px; justify-items: center; align-content: center; gap: 2px; padding: 7px 4px; border: 1px solid #d4deeb; border-radius: 10px; background: #fff; color: #173c68; font: inherit; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.agenda__dia:hover:not(:disabled) { border-color: #4781ff; background: #f2f7ff; }
.agenda__dia[aria-pressed="true"] { border: 2px solid #0a58ff; background: #eaf2ff; box-shadow: inset 0 0 0 1px #0a58ff; }
.agenda__dia:disabled { cursor: not-allowed; }
.agenda__dia--past { border-color: #d7dce3; background: #eef0f3; color: #626d79; }
.agenda__dia--past .agenda__dia-semana, .agenda__dia--past .agenda__dia-numero, .agenda__dia--past .agenda__dia-mes, .agenda__dia--past .agenda__dia-estado { color: #626d79; }
.agenda__dia--weekend { border-color: #e3a0a5; background: #fff0f1; color: #7f1820; }
.agenda__dia--weekend .agenda__dia-semana, .agenda__dia--weekend .agenda__dia-numero, .agenda__dia--weekend .agenda__dia-mes, .agenda__dia--weekend .agenda__dia-estado { color: #7f1820; }
.agenda__dia--outside-range { border-color: #d7dce3; background: #f4f5f7; color: #66717f; }
.agenda__dia--hoy { border-color: #2e7d32; background: #e8f5e9; color: #1b5e20; }
.agenda__dia--hoy .agenda__dia-semana, .agenda__dia--hoy .agenda__dia-numero, .agenda__dia--hoy .agenda__dia-mes { color: #1b5e20; }
.agenda__dia--hoy[aria-pressed="true"] { border: 2px solid #2e7d32; background: #e8f5e9; box-shadow: inset 0 0 0 1px #2e7d32, 0 0 0 2px #0a58ff; }
.agenda__dia--weekend.agenda__dia--hoy { border-color: #e3a0a5; background: #fff0f1; color: #7f1820; }
.agenda__dia--weekend.agenda__dia--hoy .agenda__dia-semana, .agenda__dia--weekend.agenda__dia--hoy .agenda__dia-numero, .agenda__dia--weekend.agenda__dia--hoy .agenda__dia-mes, .agenda__dia--weekend.agenda__dia--hoy .agenda__dia-estado:not(.agenda__dia-estado--hoy) { color: #7f1820; }
.agenda__dia-estado { color: inherit; font-size: .66rem; font-weight: 750; line-height: 1.15; text-align: center; }
.agenda__dia-estado--hoy { max-width: 100%; padding: 2px 4px; border-radius: 999px; background: #d4edda; color: #155724; font-size: .75rem; font-weight: 800; line-height: 1.2; text-align: center; }
.agenda__dia--weekend.agenda__dia--hoy .agenda__dia-estado--hoy { background: #d4edda; color: #155724; }
.agenda__dia-semana, .agenda__dia-mes { color: #52647a; font-size: .82rem; font-weight: 650; text-transform: capitalize; }
.agenda__dia-numero { color: #172b45; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.agenda__horarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 9px; }
.agenda__horario { min-height: 46px; padding: 9px 12px; border: 1px solid #aec1d7; border-radius: 9px; background: #fff; color: #173c68; font: inherit; font-weight: 700; cursor: pointer; }
.agenda__horario:hover { border-color: #0a58ff; background: #f2f7ff; }
.agenda__horario[aria-pressed="true"] { border: 2px solid #0a58ff; background: #eaf2ff; box-shadow: inset 0 0 0 1px #0a58ff; }
.agenda__horario--conflicto { border: 2px solid #a51d24; background: #fff1f1; color: #7f1820; text-decoration: line-through; }
.agenda__estado, .agenda__error, .agenda__retencion { min-height: 1.4em; margin: 8px 0; color: #465970; line-height: 1.5; }
.agenda__error { color: #a51d24; font-weight: 650; }
.agenda__retencion:not([hidden]) { padding: 10px 12px; border-radius: 8px; background: #edf4ff; color: #123d68; font-variant-numeric: tabular-nums; }
.agenda__datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.agenda__datos .agenda__campo { margin-bottom: 8px; }
.agenda__resumen { margin: 0 0 14px; padding: 12px 14px; border-radius: 8px; background: #f1f6fc; color: #334b65; line-height: 1.5; }
.agenda__captcha { margin: 18px 0; }
.agenda__captcha p { margin: 10px 0 0; }
.agenda__captcha a, .agenda__consentimiento a { color: #064e9f; font-weight: 700; text-underline-offset: 3px; }
.agenda__consentimiento { display: flex; align-items: flex-start; gap: 11px; margin: 16px 0; color: #26384d; line-height: 1.55; }
.agenda__consentimiento input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; accent-color: #0a4f91; }
.agenda__acciones { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.agenda__boton { min-width: 130px; min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; font: inherit; font-weight: 800; cursor: pointer; }
.agenda__boton--primario { background: #0a58ff; color: #fff; }
.agenda__boton--primario:hover { background: #064bdc; }
.agenda__boton--secundario { border-color: #b9c9dc; background: #fff; color: #173c68; }
.agenda__boton:disabled { cursor: not-allowed; opacity: .55; }
.agenda__captcha .contacto__captcha-cargar { min-height: 44px; margin-top: 10px; }
@media (max-width: 620px) {
    .agenda { margin: 30px 0 46px; padding: 20px 16px; }
    .agenda__progreso { gap: 4px; }
    .agenda__progreso li { justify-content: center; gap: 6px; padding: 8px 4px; font-size: .86rem; }
    .agenda__progreso li > span:first-child { flex-basis: 27px; width: 27px; height: 27px; }
    .agenda__servicios, .agenda__datos { grid-template-columns: 1fr; }
    .agenda__servicio { min-height: 84px; }
    .agenda__dias { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .agenda__dia { min-height: 78px; padding-inline: 2px; }
    .agenda__dia-estado { font-size: .61rem; }
    .agenda__dias-navegacion { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
    .agenda__dia-pagina { padding: 8px 7px; font-size: .84rem; }
    .agenda__dia-pagina:last-child { justify-self: stretch; }
    .agenda__periodo { grid-column: 1 / -1; grid-row: 1; }
    .agenda__dia-pagina:first-child { grid-column: 1; grid-row: 2; }
    .agenda__dia-pagina:last-child { grid-column: 3; grid-row: 2; }
    .agenda__horarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agenda__acciones { position: static; }
    .agenda__boton { flex: 1 1 0; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .agenda__servicio, .agenda__dia, .agenda__horario { transition: none; }
    .agenda__campo--shake { animation: none; }
}
@keyframes agendaFieldShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
