/* ==========================================================================
   v1.1 — top bar, login button, language switch, stats, testimonials, assistant, credit
   ========================================================================== */

/* ---- Top bar (contact strip above the floating header) ---- */
.site-header { padding-top: 0; }
.topbar-strip { max-height: 44px; overflow: hidden; transition: max-height .4s var(--ease), opacity .3s; font-size: .82rem; }
.site-header.is-solid .topbar-strip { max-height: 0; opacity: 0; }
.topbar-strip .container { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 40px; }
.tb-group { display: flex; align-items: center; gap: 18px; min-width: 0; }
.tb-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink-2); position: relative; transition: color .2s; }
.tb-item .icon { width: 15px; height: 15px; color: var(--primary-2); }
a.tb-item:hover { color: var(--primary); }
.tb-item + .tb-item::before { content: ''; position: absolute; right: -9px; top: 25%; bottom: 25%; width: 1px; background: var(--line-2); }
.tb-addr { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.tb-note { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.tb-note .dot { color: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .25); animation: tbpulse 2s infinite; }
@keyframes tbpulse { 50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }
.tb-social { display: flex; gap: 4px; }
.tb-social a { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); transition: .25s; }
.tb-social a:hover { background: var(--primary-soft); color: var(--primary); transform: translateY(-2px); }
.tb-social .icon { width: 15px; height: 15px; }
.site-header.on-dark:not(.is-solid) .tb-item, .site-header.on-dark:not(.is-solid) .tb-social a, .site-header.on-dark:not(.is-solid) .tb-note { color: rgba(255,255,255,.85); }
.site-header.on-dark:not(.is-solid) .tb-item .icon { color: var(--gold-2); }
.site-header.on-dark:not(.is-solid) .tb-item + .tb-item::before { background: rgba(255,255,255,.2); }
.site-header.on-dark:not(.is-solid) .tb-social a:hover { background: rgba(255,255,255,.12); color: #fff; }
.site-header.on-dark:not(.is-solid) a.tb-item:hover { color: #fff; }
.has-topbar .hero { padding-top: calc(var(--header-h) + 90px); }
.has-topbar .page-hero { padding-top: calc(var(--header-h) + 100px); }
@media (max-width: 900px) { .tb-addr, .tb-hours, .tb-note { display: none; } }
@media (max-width: 560px) { .tb-item.tb-mail { display: none; } .topbar-strip { font-size: .76rem; } .tb-group { gap: 12px; } }

/* ---- Login / account button + language switch ---- */
.btn-account { min-height: 40px; padding: 6px 16px; gap: 8px; border-radius: 999px; font-weight: 700; font-size: .88rem;
    background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line-2); color: var(--ink); }
.btn-account:hover { border-color: var(--primary); color: var(--primary); }
.btn-account .avatar { width: 26px; height: 26px; font-size: .68rem; }
.site-header.on-dark:not(.is-solid) .btn-account { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.site-header.on-dark:not(.is-solid) .btn-account:hover { background: rgba(255,255,255,.2); }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .74rem; font-weight: 800; }
.lang-switch a { padding: 4px 9px; border-radius: 999px; color: var(--muted); line-height: 1.4; }
.lang-switch a.is-on { background: var(--g-primary); color: #fff; }
.site-header.on-dark:not(.is-solid) .lang-switch { border-color: rgba(255,255,255,.3); }
.site-header.on-dark:not(.is-solid) .lang-switch a:not(.is-on) { color: rgba(255,255,255,.85); }
@media (max-width: 1280px) { .btn-account .acc-label { display: none; } .btn-account { padding: 6px; width: 40px; justify-content: center; } }
@media (max-width: 1100px) { .hdr-actions .btn-panel { display: inline-flex; } }
@media (max-width: 420px) { .hdr-actions .lang-switch { display: none; } }

/* ---- Stats bar: lives below the hero (it was clipped by the hero's overflow) ---- */
.hero { padding-bottom: 120px; }
.stats-wrap { position: relative; z-index: 5; margin-top: -64px; }
.stats-bar .stat b { direction: ltr; unicode-bidi: isolate; }
.stats-bar .stat > span { display: block; margin-top: 4px; }
@media (max-width: 1024px) { .hero { padding-bottom: 110px; } }

/* ---- Testimonials v2: wide luxurious cards ---- */
.carousel3d { height: 440px; }
.c3d-item { width: min(640px, 88vw); margin-left: calc(min(640px, 88vw) / -2); }
.c3d-item .tcard {
    position: relative; overflow: hidden; padding: 40px 44px 34px; min-height: 340px; border-radius: 36px; border: 1px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box,
                linear-gradient(135deg, color-mix(in srgb, var(--lav) 60%, transparent), transparent 42%, color-mix(in srgb, var(--peach) 60%, transparent)) border-box;
    box-shadow: 0 30px 70px -28px rgba(13, 59, 69, .38);
}
.c3d-item .tcard .t-mark { position: absolute; top: -18px; left: 26px; font-size: 12rem; line-height: 1; font-family: Georgia, serif; color: var(--lav-soft); pointer-events: none; z-index: 0; }
[dir="ltr"] .c3d-item .tcard .t-mark { left: auto; right: 26px; }
.c3d-item .tcard .t-glow { position: absolute; width: 280px; height: 280px; border-radius: 50%; bottom: -170px; right: -110px; background: radial-gradient(closest-side, color-mix(in srgb, var(--primary-2) 24%, transparent), transparent); pointer-events: none; z-index: 0; }
.tcard > *:not(.t-mark):not(.t-glow) { position: relative; z-index: 1; }
.tcard .t-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tcard .t-service { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--primary-soft); color: var(--primary); }
.tcard p { font-size: 1.1rem; line-height: 2.05; color: var(--ink); font-weight: 500; flex: 1; }
[dir="ltr"] .tcard p { line-height: 1.8; }
.tcard .t-person { display: flex; align-items: center; gap: 14px; padding-top: 18px; margin-top: 8px; border-top: 1px dashed var(--line-2); }
.tcard .t-person .avatar { width: 54px; height: 54px; font-size: 1.15rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px color-mix(in srgb, var(--lav) 45%, transparent); }
.tcard .t-person b { display: block; font-size: 1rem; }
.tcard .t-person small { color: var(--muted); }
.c3d-dots { display: flex; justify-content: center; gap: 8px; }
.c3d-dots button { width: 10px; height: 10px; border-radius: 99px; border: 0; padding: 0; background: var(--line-2); cursor: pointer; transition: .35s var(--ease); }
.c3d-dots button.is-on { width: 30px; background: var(--g-warm); }
.c3d-nav { align-items: center; gap: 16px; }
@media (max-width: 640px) { .carousel3d { height: 500px; } .c3d-item .tcard { padding: 30px 24px 26px; } .tcard p { font-size: 1rem; } }

/* ---- Assistant widget ---- */
.assistant-fab { position: fixed; z-index: 95; bottom: 22px; left: 22px; width: 64px; height: 64px; border-radius: 22px; border: 0; cursor: pointer; color: #fff;
    background: var(--g-dream); box-shadow: inset 0 -6px 12px rgba(0,0,0,.15), inset 0 5px 10px rgba(255,255,255,.35), 0 18px 40px -12px rgba(142,124,240,.8);
    display: grid; place-items: center; transition: transform .4s var(--ease-spring), border-radius .4s; }
.assistant-fab:hover { transform: translateY(-3px) rotate(-6deg); }
.assistant-fab .af-ring { position: absolute; inset: -6px; border-radius: 26px; border: 2px solid rgba(142,124,240,.5); animation: ping 2.6s var(--ease) infinite; pointer-events: none; }
.assistant-fab .af-close { display: none; }
.assistant.is-open .assistant-fab { border-radius: 50%; }
.assistant.is-open .af-open, .assistant.is-open .af-ring { display: none; }
.assistant.is-open .af-close { display: block; }
.af-tip { position: absolute; bottom: 74px; left: 0; white-space: nowrap; padding: 8px 14px; border-radius: 14px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: .85rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: .4s var(--ease); pointer-events: none; }
.assistant.show-tip:not(.is-open) .af-tip { opacity: 1; transform: none; }
[dir="ltr"] .af-tip { left: auto; right: 0; }
.assistant-panel { position: fixed; z-index: 96; bottom: 100px; left: 22px; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 130px)); display: flex; flex-direction: column;
    background: var(--surface); border-radius: 30px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .45s var(--ease-spring); transform-origin: bottom left; }
.assistant-panel[hidden] { display: none; }
.ap-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: #fff; background: radial-gradient(300px 120px at 0 0, rgba(183,171,247,.45), transparent 60%), var(--g-deep); }
.ap-head b { display: block; color: #fff; line-height: 1.5; }
.ap-head small { font-size: .74rem; color: rgba(255,255,255,.7); }
.ap-avatar { position: relative; flex: none; }
.ap-dot { position: absolute; bottom: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px #134a52; }
.ap-icon { width: 34px; height: 34px; border-radius: 11px; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.ap-icon:hover { background: rgba(255,255,255,.2); }
.ap-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); scroll-behavior: smooth; }
.ap-msg { max-width: 88%; padding: 11px 15px; border-radius: 20px; font-size: .9rem; line-height: 1.9; word-wrap: break-word; animation: toastIn .35s var(--ease); }
.ap-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-start-start-radius: 6px; }
.ap-msg.me { align-self: flex-end; background: var(--g-primary); color: #fff; border-start-end-radius: 6px; }
.ap-msg.crisis { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.ap-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ap-links a { padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 700; }
.ap-links a:hover { background: var(--primary); color: #fff; }
.ap-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.ap-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: apblink 1.2s infinite; }
.ap-typing i:nth-child(2) { animation-delay: .2s; } .ap-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes apblink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ap-suggest { display: flex; gap: 6px; padding: 10px 14px 0; overflow-x: auto; background: var(--bg); scrollbar-width: none; }
.ap-suggest[hidden] { display: none; }
.ap-suggest button { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 600; cursor: pointer; transition: .2s; }
.ap-suggest button:hover { border-color: var(--primary); color: var(--primary); }
.ap-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; background: var(--bg); }
.ap-form textarea { flex: 1; resize: none; min-height: 46px; max-height: 120px; padding: 11px 16px; border-radius: 18px; border: 1.5px solid var(--line-2); background: var(--surface); outline: none; line-height: 1.6; color: var(--ink); }
.ap-form textarea:focus { border-color: var(--primary-2); }
.ap-send { width: 46px; height: 46px; flex: none; border-radius: 16px; border: 0; background: var(--g-primary); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-glow); }
.ap-note { margin: 0; padding: 0 16px 10px; font-size: .7rem; color: var(--muted); background: var(--bg); text-align: center; }
[dir="ltr"] .assistant-fab { left: auto; right: 22px; }
[dir="ltr"] .assistant-panel { left: auto; right: 22px; transform-origin: bottom right; }
[dir="ltr"] .ap-dot { left: auto; right: 0; }
@media (max-width: 560px) {
    .assistant-fab { width: 56px; height: 56px; bottom: 16px; left: 16px; }
    .assistant-panel { left: 8px; right: 8px; width: auto; bottom: 84px; height: calc(100vh - 110px); border-radius: 24px; }
    [dir="ltr"] .assistant-fab { left: auto; right: 16px; }
    [dir="ltr"] .assistant-panel { right: 8px; }
}

/* ---- Footer credit ---- */
.dev-credit { display: inline-flex; align-items: center; gap: 6px; opacity: .9; }
.dev-credit a { color: var(--gold-2); font-weight: 800; border-bottom: 1px dashed rgba(241,208,140,.5); transition: .2s; }
.dev-credit a:hover { color: #fff; border-bottom-color: #fff; }

/* header fit (both languages) */
.nav > a, .nav-drop > button { white-space: nowrap; padding: 8px 11px; }
.site-header .brand-text { max-width: 230px; }
@media (max-width: 1440px) { [dir="ltr"] .btn-account .acc-label { display: none; } [dir="ltr"] .btn-account { padding: 6px; width: 40px; justify-content: center; } [dir="ltr"] .site-header .brand-text small { display: none; } }
@media (max-width: 1240px) { .nav > a, .nav-drop > button { padding: 8px 8px; font-size: .88rem; } }
.stats-bar .stat b span { font-size: inherit; color: inherit; font-weight: inherit; display: inline; margin: 0; }
