/* Contact form redesign: one-box phone with searchable country list, topic chips, polished fields. */
.cf-wrap { position: relative; padding: clamp(1.6rem, 3vw, 2.6rem); border: 1px solid var(--border); border-radius: 1.6rem; background: #fff; box-shadow: 0 30px 70px rgba(15, 23, 42, .08); overflow: visible; }
.cf-wrap-title { font-size: 1.6rem; }
.cf-wrap-sub { margin-bottom: 1.8rem; }
.cf-label { display: block; margin-bottom: .45rem; font-size: .82rem; font-weight: 700; color: var(--ink); }
.cf-field { margin-bottom: 1.15rem; }
.cf-inp, .cf-sel, .cf-ta { height: 3.25rem; border-radius: .9rem; background: #f8fafc; border: 1.5px solid #e5e9f0; font-size: .95rem; }
.cf-ta { height: auto; min-height: 8.5rem; padding: .9rem 1rem; line-height: 1.6; resize: vertical; }
.cf-inp::placeholder, .cf-ta::placeholder { color: #a3adbb; }

/* Phone: one field with the country button inside */
.cf-tel { position: relative; display: flex; align-items: stretch; height: 3.25rem; border: 1.5px solid #e5e9f0; border-radius: .9rem; background: #f8fafc; transition: border-color .2s, box-shadow .2s, background .2s; }
.cf-tel:hover { border-color: #cbd5e1; }
.cf-tel:focus-within, .cf-tel.is-open { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.cf-tel:has(.cf-tel__num.err) { border-color: #ef4444; background: #fff8f8; box-shadow: 0 0 0 3px rgba(239, 68, 68, .09); }
.cf-tel__code { flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: 0 .85rem 0 .9rem; border: 0; border-inline-end: 1.5px solid #e5e9f0; border-radius: .9rem 0 0 .9rem; background: transparent; font: inherit; font-size: .95rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.cf-tel__code:hover { background: rgba(37, 99, 235, .05); }
.cf-tel__flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08); }
.cf-tel__code > i { font-size: .65rem; color: var(--soft); transition: transform .2s; }
.cf-tel.is-open .cf-tel__code > i { transform: rotate(180deg); }
.cf-tel .cf-tel__num { flex: 1; min-width: 0; height: 100%; padding: 0 1rem; border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0 .9rem .9rem 0; font-size: .98rem; letter-spacing: .02em; }
.cf-tel__menu { position: absolute; z-index: 30; top: calc(100% + .5rem); left: 0; width: min(100%, 22rem); padding: .55rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .18); }
.cf-tel__menu[hidden] { display: none; }
.cf-tel__search { display: flex; align-items: center; gap: .55rem; height: 2.6rem; padding: 0 .8rem; margin-bottom: .45rem; border: 1.5px solid #e5e9f0; border-radius: .7rem; background: #f8fafc; color: var(--soft); }
.cf-tel__search:focus-within { border-color: var(--brand); background: #fff; }
.cf-tel__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .9rem; color: var(--text); }
.cf-tel__list { list-style: none; margin: 0; padding: 0; max-height: 16rem; overflow-y: auto; overscroll-behavior: contain; }
.cf-tel__opt { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; border-radius: .6rem; font-size: .9rem; color: var(--text); cursor: pointer; }
.cf-tel__opt img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08); flex: none; }
.cf-tel__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-tel__opt b { font-size: .84rem; color: var(--muted); font-weight: 700; }
.cf-tel__opt:hover, .cf-tel__opt.is-active { background: #f1f5ff; }
.cf-tel__opt.is-on { background: rgba(37, 99, 235, .1); color: var(--brand); font-weight: 700; }
.cf-tel__opt.is-on b { color: var(--brand); }
.cf-tel__none { padding: 1rem; text-align: center; font-size: .85rem; color: var(--muted); }
[dir="rtl"] .cf-tel__menu { left: auto; right: 0; }
[dir="rtl"] .cf-tel__name { text-align: right; }

/* Subject as chips */
.cf-topics { display: flex; flex-wrap: wrap; gap: .5rem; }
.cf-topic { display: inline-flex; align-items: center; gap: .5rem; height: 2.6rem; padding: 0 1rem; border: 1.5px solid #e5e9f0; border-radius: 999px; background: #f8fafc; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer; transition: all .2s; }
.cf-topic i { font-size: .82rem; color: var(--soft); transition: color .2s; }
.cf-topic:hover { border-color: #c7d2fe; background: #fff; }
.cf-topic.is-on { border-color: var(--brand); background: rgba(37, 99, 235, .08); color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.cf-topic.is-on i { color: var(--brand); }
.cf-topics__native { position: absolute !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.cf-field:has(#cf-subject.err) .cf-topic { border-color: #fca5a5; }

/* Message + counter */
.cf-field:has(#cf-msg) { position: relative; }
.cf-count { position: absolute; bottom: .65rem; inset-inline-end: .9rem; font-size: .72rem; font-weight: 600; color: #a3adbb; pointer-events: none; }
.cf-count.is-near { color: #d97706; }
.cf-field:has(#cf-msg) .cf-err-msg + .cf-count, .cf-field:has(#cf-msg .err) .cf-count { bottom: 2.1rem; }

/* Button */
.cf-btn { height: 3.4rem; border-radius: 999px; font-size: 1rem; letter-spacing: .01em; box-shadow: 0 14px 30px rgba(37, 99, 235, .3); transition: transform .2s, box-shadow .2s, filter .2s; }
.cf-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(37, 99, 235, .38); filter: brightness(1.05); }
.cf-btn i { transition: transform .3s; }
.cf-btn:hover i { transform: translate(3px, -3px) rotate(-8deg); }
@media (max-width: 640px) { .cf-tel__menu { width: 100%; } .cf-topic { flex: 1 1 calc(50% - .5rem); justify-content: center; } }

/* Subject dropdown + "Other" text box */
.cf-other { margin-top: .65rem; animation: cfOtherIn .25s ease; }
.cf-other[hidden] { display: none; }
@keyframes cfOtherIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cf-tel:has(.cf-tel__num[aria-invalid="true"]) { border-color: #ef4444; background: #fff8f8; }

/* focus-ring: field inside a ringed box (generated) */
.cf-tel :is(input, select, textarea):focus,
.cf-tel__search :is(input, select, textarea):focus { outline: none; }
