/* ===== Kauthar — international phone field + country picker (public/js/kphone.js). Self-contained: works with and without Bootstrap. ===== */
.kphone { display: flex; align-items: stretch; direction: ltr; width: 100%; position: relative; }
.kphone .kphone-cc { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; padding: 0 .6rem; min-height: 44px; font: inherit; font-weight: 600;
  color: #0f172a; background: #f8fafc; border: 1px solid #cbd5e1; border-right: 0; border-radius: .5rem 0 0 .5rem; cursor: pointer; white-space: nowrap; }
.kphone .kphone-cc:hover, .kphone .kphone-cc:focus-visible { background: #eef2ff; outline: none; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .18); position: relative; z-index: 3; }
.kphone .kphone-cc .bi { font-size: .7rem; opacity: .6; }
.kphone .kphone-flag { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); background: #e2e8f0; }
.kphone .kphone-dial { font-variant-numeric: tabular-nums; direction: ltr; }
.kphone .kphone-num { flex: 1 1 auto; min-width: 0; direction: ltr; text-align: left; border-radius: 0 .5rem .5rem 0; }
/* Bootstrap input-group context (auth / dashboard forms). The group is always LTR (number + dial code read left-to-right), so the
   radii are set explicitly for both sides — the RTL Bootstrap sheet would otherwise round the wrong corners. */
.input-group.kphone { --kp-r: var(--bs-border-radius, .375rem); }
.input-group-lg.kphone { --kp-r: var(--bs-border-radius-lg, .5rem); }
.input-group-sm.kphone { --kp-r: var(--bs-border-radius-sm, .25rem); }
.input-group.kphone > .kphone-cc { margin: 0 !important; border-color: var(--bs-border-color, #dee2e6); border-right: 0;
  border-radius: var(--kp-r) 0 0 var(--kp-r) !important; }
.input-group-lg.kphone > .kphone-cc { font-size: 1rem; }
.input-group.kphone > .kphone-num { margin: 0 !important; border-radius: 0 var(--kp-r) var(--kp-r) 0 !important; }
.input-group.kphone > .invalid-feedback { direction: inherit; }
html[dir=rtl] .input-group.kphone > .invalid-feedback { text-align: right; direction: rtl; }
.was-validated .kphone .kphone-num:invalid, .kphone .kphone-num.is-invalid { border-color: var(--bs-form-invalid-border-color, #dc3545); }

/* picker: bottom sheet on phones, centered card on larger screens */
html.kphone-open, html.kphone-open body { overflow: hidden; }
.kphone-sheet { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: flex-end; justify-content: center; font-family: inherit; }
.kphone-sheet[hidden] { display: none; }
.kphone-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.kphone-panel { position: relative; background: #fff; color: #0f172a; width: 100%; max-width: 480px; height: 86vh; height: 86dvh; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); padding-bottom: env(safe-area-inset-bottom, 0); animation: kpUp .18s ease-out; }
@keyframes kpUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 576px) { .kphone-sheet { align-items: center; } .kphone-panel { height: auto; max-height: 76vh; border-radius: 16px; } }
.kphone-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; font-size: 1.05rem; }
.kphone-x { border: 0; background: #f1f5f9; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: #334155; }
.kphone-search { position: relative; margin: 0 16px 8px; }
.kphone-search .bi { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: #94a3b8; pointer-events: none; }
.kphone-search input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 10px 12px; padding-inline-start: 36px; border: 1px solid #cbd5e1;
  border-radius: 12px; background: #f8fafc; outline: none; }
.kphone-search input:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.kphone-list { list-style: none; margin: 0; padding: 0 8px 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; }
.kphone-list li { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.kphone-list li:hover, .kphone-list li:focus { background: #eef2ff; outline: none; }
.kphone-list li[aria-selected=true] { background: #e0e7ff; font-weight: 700; }
.kphone-list li.kp-sep { margin-top: 6px; border-top: 1px solid #e2e8f0; padding-top: 14px; }
.kphone-list.is-filtered li.kp-sep { margin-top: 0; border-top: 0; padding-top: 11px; }
.kphone-list li img { width: 24px; height: 18px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: 0 0 auto; background: #e2e8f0; }
.kphone-list .kp-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kphone-list .kp-d { color: #64748b; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.kphone-none { padding: 24px 16px; text-align: center; color: #64748b; }
