/*
 * Smile Invent: lead forms, booking buttons, mobile action bar and the chat widget.
 * Loaded on every page after the legacy sheets. Everything is prefixed si- so it cannot
 * collide with style.css / default.css.
 */
:root {
    --si-blue: #014E94;
    --si-blue-dark: #013b70;
    --si-teal: #16ACBD;
    --si-teal-soft: #e8f7f9;
    --si-ink: #1d2733;
    --si-muted: #5d6b78;
    --si-line: #d9e4ec;
    --si-wa: #25D366;
    --si-danger: #c62828;
    --si-radius: 14px;
}

/* ---------- Buttons ---------- */
.si-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: 16px; line-height: 1.2; border: 2px solid transparent; text-decoration: none !important; cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.si-btn--primary { background: var(--si-blue); color: #fff !important; }
.si-btn--primary:hover { background: var(--si-blue-dark); }
.si-btn--outline { background: #fff; color: var(--si-blue) !important; border-color: var(--si-blue); }
.si-btn--outline:hover { background: var(--si-teal-soft); }
.si-btn--wa { background: var(--si-wa); color: #fff !important; }
.si-btn--wa:hover { background: #1fb457; }
.si-btn--block { width: 100%; }
.si-btn[disabled] { opacity: .7; cursor: wait; }

/* ---------- Lead form card ---------- */
.si-form-card { background: #fff; border-radius: var(--si-radius); box-shadow: 0 18px 40px rgba(1, 78, 148, .14); padding: 24px 22px 18px; color: var(--si-ink); text-align: left; scroll-margin-top: 110px; border-top: 4px solid var(--si-teal); }
.si-form-card__title { font-size: 21px; font-weight: 700; color: var(--si-blue); margin: 0 0 4px; font-family: 'DM Sans', sans-serif; }
.si-form-card__note { font-size: 14px; color: var(--si-muted); margin: 0 0 14px; line-height: 1.5; }
.si-lead-form .si-field { margin-bottom: 11px; }
.si-lead-form label { display: block; font-size: 13.5px; font-weight: 600; color: var(--si-ink); margin-bottom: 4px; }
.si-lead-form label span { color: var(--si-danger); }
.si-lead-form label small { font-weight: 400; color: var(--si-muted); }
.si-lead-form input[type=text], .si-lead-form input[type=tel], .si-lead-form input[type=email], .si-lead-form input[type=date], .si-lead-form select, .si-lead-form textarea {
    width: 100%; border: 1px solid var(--si-line); border-radius: 9px; padding: 10px 12px; font-size: 15px; color: var(--si-ink); background: #fbfdfe; min-height: 44px; font-family: inherit;
}
.si-lead-form input:focus, .si-lead-form select:focus, .si-lead-form textarea:focus { outline: none; border-color: var(--si-teal); box-shadow: 0 0 0 3px rgba(22, 172, 189, .18); background: #fff; }
.si-lead-form input[type=file] { font-size: 14px; width: 100%; padding: 8px; border: 1px dashed var(--si-line); border-radius: 9px; background: #fbfdfe; }
.si-lead-form .iti { width: 100%; }
.si-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.si-field.has-error input, .si-field.has-error select, .si-field.has-error textarea { border-color: var(--si-danger); }
.si-field-error { display: block; color: var(--si-danger); font-size: 12.5px; margin-top: 3px; }
.si-form-error { color: var(--si-danger); font-size: 13.5px; margin: 6px 0 10px; }
.si-more-toggle { background: none; border: 0; padding: 0; margin: 0 0 12px; color: var(--si-blue); font-weight: 600; font-size: 14px; cursor: pointer; }
.si-form-foot { font-size: 13px; color: var(--si-muted); margin: 10px 0 0; text-align: center; }
.si-form-foot a { color: var(--si-blue); font-weight: 600; }
.si-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 420px) { .si-row { grid-template-columns: 1fr; gap: 0; } }

/* Treatment page hero: the form takes the place of the picture */
.treat-banner-first .right-sec .si-form-card { max-width: 440px; margin: 10px auto; }
@media (max-width: 991.98px) { .treat-banner-first .right-sec .si-form-card { margin: 18px auto 8px; } }

/* Home hero form */
.si-home-hero-form { max-width: 430px; margin-left: auto; }
@media (max-width: 991.98px) { .si-home-hero-form { margin: 26px auto 0; } }

/* Strip of facts under heroes */
.si-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 14.5px; }
.si-facts li { display: flex; align-items: center; gap: 7px; }
.si-facts i { color: var(--si-teal); }

/* Header button */
.btn-book { background: var(--si-teal); color: #fff !important; padding: 10px 15px !important; border-radius: 4px; font-weight: 600; margin-left: 10px; text-decoration: none; white-space: nowrap; }
.btn-book:hover { background: #119aaa; }

/* ---------- Generic section used on new blocks ---------- */
.si-section { padding: 70px 0; }
.si-section--soft { background: var(--si-teal-soft); }
.si-section h2 { color: var(--si-blue); font-weight: 700; font-size: clamp(26px, 3vw, 34px); margin-bottom: 12px; }
.si-section .si-lead { color: var(--si-muted); font-size: 16.5px; max-width: 760px; }
.si-doctor { display: flex; gap: 18px; background: #fff; border-radius: var(--si-radius); padding: 18px; border: 1px solid var(--si-line); height: 100%; }
.si-doctor img { width: 110px; height: 130px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: var(--si-teal-soft); }
.si-doctor h3 { font-size: 19px; color: var(--si-blue); margin: 0 0 4px; font-weight: 700; }
.si-doctor .si-doctor__qual { font-weight: 600; color: var(--si-ink); font-size: 14.5px; margin: 0 0 6px; }
.si-doctor p { font-size: 14.5px; color: var(--si-muted); margin: 0 0 4px; }
.si-steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.si-steps li { background: #fff; border: 1px solid var(--si-line); border-radius: var(--si-radius); padding: 18px 18px 16px 58px; position: relative; font-size: 15px; color: var(--si-muted); }
.si-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--si-blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.si-steps strong { display: block; color: var(--si-ink); margin-bottom: 3px; }
.si-visit { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: stretch; }
.si-visit__card { background: #fff; border-radius: var(--si-radius); border: 1px solid var(--si-line); padding: 22px; }
.si-visit__card dl { margin: 0; }
.si-visit__card dt { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--si-muted); margin-top: 12px; }
.si-visit__card dd { margin: 2px 0 0; font-size: 15.5px; color: var(--si-ink); }
.si-visit__card dd a { color: var(--si-blue); font-weight: 600; }
.si-visit iframe { width: 100%; height: 100%; min-height: 320px; border: 0; border-radius: var(--si-radius); }
@media (max-width: 767.98px) { .si-visit { grid-template-columns: 1fr; } .si-section { padding: 50px 0; } }

/* ---------- Floating buttons and the mobile action bar ---------- */
.whatsapp-float { bottom: 96px !important; right: 22px !important; width: 54px !important; height: 54px !important; font-size: 28px !important; }
.si-actionbar { display: none; }
@media (max-width: 767.98px) {
    body { padding-bottom: 64px; }
    .whatsapp-float { display: none !important; }
    .si-actionbar { display: grid; grid-template-columns: 1fr 1fr 1.25fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; background: #fff; box-shadow: 0 -4px 18px rgba(0, 0, 0, .12); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
    .si-actionbar a { display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; padding: 11px 6px; font-weight: 600; font-size: 14.5px; text-decoration: none; }
    .si-actionbar .is-call { border: 1.5px solid var(--si-blue); color: var(--si-blue); }
    .si-actionbar .is-wa { background: var(--si-wa); color: #fff; }
    .si-actionbar .is-book { background: var(--si-blue); color: #fff; }
}

/* ---------- Chat widget ---------- */
.si-chat-launcher { position: fixed; right: 22px; bottom: 24px; z-index: 1060; display: flex; align-items: center; gap: 10px; background: var(--si-blue); color: #fff; border: 0; border-radius: 30px; padding: 12px 18px 12px 14px; font-weight: 600; font-size: 15px; box-shadow: 0 10px 26px rgba(1, 78, 148, .35); cursor: pointer; }
.si-chat-launcher i { font-size: 20px; }
.si-chat-launcher:hover { background: var(--si-blue-dark); }
.si-chat-launcher[hidden] { display: none; }
@media (max-width: 767.98px) {
    .si-chat-launcher { bottom: 76px; right: 14px; padding: 12px; border-radius: 50%; }
    .si-chat-launcher span { display: none; }
}
.si-chat { position: fixed; right: 22px; bottom: 24px; z-index: 1070; width: 370px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 48px); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); display: flex; flex-direction: column; overflow: hidden; font-size: 15px; color: var(--si-ink); }
.si-chat[hidden] { display: none; }
@media (max-width: 767.98px) { .si-chat { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; } }
.si-chat__head { background: var(--si-blue); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.si-chat__head img { width: 38px; height: 38px; border-radius: 50%; background: #fff; object-fit: contain; padding: 4px; }
.si-chat__head strong { display: block; font-size: 15.5px; }
.si-chat__head small { opacity: .85; font-size: 12.5px; }
.si-chat__close { margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px; }
.si-chat__body { flex: 1; overflow-y: auto; padding: 14px; background: #f5f9fb; display: flex; flex-direction: column; gap: 10px; }
.si-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.si-msg a { color: inherit; text-decoration: underline; }
.si-msg--bot { background: #fff; border: 1px solid var(--si-line); align-self: flex-start; border-bottom-left-radius: 4px; }
.si-msg--user { background: var(--si-blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.si-msg--typing { color: var(--si-muted); font-style: italic; }
.si-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.si-chat__chips button { background: #fff; border: 1px solid var(--si-teal); color: var(--si-blue); border-radius: 18px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; }
.si-chat__chips button:hover { background: var(--si-teal-soft); }
.si-chat__actions { display: flex; gap: 8px; }
.si-chat__actions a { flex: 1; font-size: 14px; padding: 9px 10px; }
.si-chat__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--si-line); background: #fff; }
.si-chat__form textarea { flex: 1; resize: none; border: 1px solid var(--si-line); border-radius: 10px; padding: 9px 11px; font-size: 15px; font-family: inherit; max-height: 110px; min-height: 42px; }
.si-chat__form textarea:focus { outline: none; border-color: var(--si-teal); }
.si-chat__form button { background: var(--si-blue); color: #fff; border: 0; border-radius: 10px; width: 46px; font-size: 18px; cursor: pointer; }
.si-chat__form button[disabled] { opacity: .6; }
.si-chat__foot { font-size: 11.5px; color: var(--si-muted); text-align: center; padding: 0 10px 8px; background: #fff; }

/* Country code picker: readable dial code on every background (it inherited white text in the
   blue booking bar), and a selector that looks part of the field. */
.si-lead-form .iti__selected-dial-code { color: var(--si-ink, #1d2733) !important; font-weight: 600; font-size: 15px; margin-left: 6px; }
.si-lead-form .iti--separate-dial-code .iti__selected-flag,
.si-lead-form .iti__selected-flag { background: #f3f7fa !important; border-right: 1px solid var(--si-line, #d9e4ec); border-radius: 9px 0 0 9px; padding: 0 10px 0 12px; }
.si-lead-form .iti__arrow { border-top-color: #5d6b78; margin-left: 6px; }
.si-lead-form .iti__country-list { color: var(--si-ink, #1d2733); }

/* Guided chat: the text box only shows when the chat asks for a name or phone number. */
.si-chat__form[hidden] { display: none; }

/* Free assistant: the booking chip stands out; answers can carry a short list. */
.si-chat__chips button.is-primary { background: var(--si-blue); border-color: var(--si-blue); color: #fff; font-weight: 600; }
.si-chat__chips button.is-primary:hover { background: var(--si-blue-dark); }
.si-msg--bot ul { margin: 8px 0 6px; padding-left: 18px; }
.si-msg--bot li { margin: 3px 0; }
.si-msg--bot ol { margin: 8px 0 8px; padding-left: 18px; }

/* Tooth mascot (Oct 2026): round avatar on the launcher and in the chat header. */
.si-chat-launcher__mascot { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; display: block; margin: -6px 0 -6px -6px; }
.si-chat__head img.si-chat__mascot { width: 42px; height: 42px; padding: 0; border: 2px solid #fff; object-fit: cover; }
@media (max-width: 767.98px) {
    .si-chat-launcher:has(.si-chat-launcher__mascot) { padding: 4px; }
    .si-chat-launcher__mascot { width: 52px; height: 52px; margin: 0; }
}

/* Start again button (Oct 2026), next to close. */
.si-chat__restart { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #fff; opacity: .85; cursor: pointer; }
.si-chat__restart:hover, .si-chat__restart:focus-visible { background: rgba(255, 255, 255, .15); opacity: 1; }
.si-chat__restart + .si-chat__close { margin-left: 0; }

/* Message box (Oct 2026): one clean line that grows with the text; send button stays at the bottom. */
.si-chat__form { align-items: flex-end; }
.si-chat__form textarea { line-height: 1.4; height: 42px; overflow-y: hidden; }
.si-chat__form textarea::placeholder { color: #8a94a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-chat__form button { height: 42px; flex: 0 0 46px; }
@media (max-width: 767.98px) { .si-chat__form textarea { font-size: 16px; } }
