/* ==========================================================================
   DoctorsHub24 — International Medical Tourism Booking Dynamic Enhancements
   ========================================================================== */

.dh-mt-page,
dialog.dhib-auth-dialog {
  --dhib-teal: #0d9488;
  --dhib-teal-dark: #0f766e;
  --dhib-teal-soft: #f0fdfa;
  --dhib-ink: #0f172a;
  --dhib-muted: #64748b;
  --dhib-line: #e2e8f0;
  --dhib-amber-bg: #fffbeb;
  --dhib-amber-line: #fde68a;
  --dhib-amber-ink: #92400e;
  --dhib-red-bg: #fef2f2;
  --dhib-red-line: #fecaca;
  --dhib-red-ink: #b91c1c;
}

/* ---------- 6-Step Progress Stepper ---------- */
.dhib-steps-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  margin-block-end: 1.25rem;
  padding: 0.55rem;
  background: #ffffff;
  border: 1px solid var(--dhib-line);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.dhib-step-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #475569;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
  min-height: 44px;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.dhib-step-btn:hover {
  background: #f1f5f9;
  color: var(--dhib-ink);
}

.dhib-step-btn:focus-visible {
  outline: 3px solid var(--dhib-teal);
  outline-offset: 2px;
}

.dhib-step-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 800;
}

.dhib-step-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dhib-step-btn[aria-current="step"] {
  background: var(--dhib-teal-soft);
  border-color: #99f6e4;
  color: var(--dhib-teal-dark);
}

.dhib-step-btn[aria-current="step"] .dhib-step-num {
  background: var(--dhib-teal);
  color: #ffffff;
}

.dhib-step-btn.is-done:not([aria-current="step"]) {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.dhib-step-btn.is-done .dhib-step-num {
  background: #10b981;
  color: #ffffff;
}

.dhib-step-anchor {
  scroll-margin-top: 90px;
}

/* ---------- Auth Status Pill & Quick Auth Triggers ---------- */
.dh-mt-alert.is-authenticated {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.dhib-auth-trigger {
  cursor: pointer;
  font: inherit;
}

.dhib-draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  margin-block-end: 1rem;
}

.dhib-draft-clear {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.dhib-draft-clear:hover {
  border-color: var(--dhib-teal);
  color: var(--dhib-teal-dark);
}

/* ---------- Destination Intel Strip ---------- */
.dhib-dest-intel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-block: 0.35rem 1.15rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  border: 1px solid #99f6e4;
  border-radius: 14px;
}

.dhib-intel-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dhib-intel-k {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dhib-teal-dark);
}

.dhib-intel-v {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dhib-ink);
  line-height: 1.3;
}

/* ---------- Selected Specialist Preview Card ---------- */
.dhib-doctor-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--dhib-line);
  border-radius: 12px;
}

.dhib-doctor-card.has-doc {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.dhib-doc-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dhib-doc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #ccfbf1;
  color: var(--dhib-teal-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex: 0 0 auto;
}

.dhib-doc-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--dhib-ink);
}

.dhib-doc-meta {
  font-size: 0.77rem;
  color: var(--dhib-muted);
  margin-top: 0.1rem;
}

.dhib-doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dhib-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--dhib-ink);
}

.dhib-mini-pill.is-teal {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
}

/* ---------- Preferred Consultation Slot Chips ---------- */
.dhib-slot-field {
  grid-column: 1 / -1;
}

.dhib-slot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dhib-slot-btn {
  padding: 0.48rem 0.8rem;
  border-radius: 10px;
  border: 1.5px solid var(--dhib-line);
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 40px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.dhib-slot-btn:hover {
  border-color: var(--dhib-teal);
  color: var(--dhib-teal-dark);
}

.dhib-slot-btn.is-active {
  background: var(--dhib-teal);
  border-color: var(--dhib-teal);
  color: #ffffff;
}

.dhib-slot-btn:focus-visible {
  outline: 3px solid var(--dhib-teal);
  outline-offset: 2px;
}

/* ---------- Dependents Switcher & Clinical Templates ---------- */
.dhib-dep-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-end: 0.9rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--dhib-line);
  border-radius: 12px;
}

.dhib-dep-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  margin-inline-end: 0.25rem;
}

.dhib-chip-btn {
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  min-height: 36px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dhib-chip-btn:hover {
  border-color: var(--dhib-teal);
  color: var(--dhib-teal-dark);
}

.dhib-chip-btn.is-active {
  background: var(--dhib-teal-soft);
  border-color: var(--dhib-teal);
  color: var(--dhib-teal-dark);
}

.dhib-diag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-block-end: 0.45rem;
}

/* ---------- Passport 6-Month Validity Alert ---------- */
.dhib-passport-alert {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.dhib-passport-alert.is-warn {
  background: var(--dhib-amber-bg);
  border: 1px solid var(--dhib-amber-line);
  color: var(--dhib-amber-ink);
}

.dhib-passport-alert.is-danger {
  background: var(--dhib-red-bg);
  border: 1px solid var(--dhib-red-line);
  color: var(--dhib-red-ink);
}

.dhib-passport-alert.is-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* ---------- Form Validation (:user-invalid instead of :invalid) ---------- */
.dh-mt-field input,
.dh-mt-field select,
.dh-mt-field textarea {
  font-size: max(0.95rem, 1em);
}

.dh-mt-field input:focus-visible,
.dh-mt-field select:focus-visible,
.dh-mt-field textarea:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.25);
  border-color: var(--dhib-teal);
}

.dh-mt-field input:user-invalid,
.dh-mt-field select:user-invalid,
.dh-mt-field textarea:user-invalid,
.dh-mt-field [aria-invalid="true"] {
  border-color: #dc2626 !important;
  background-color: #fffafa;
}

.dhib-field-error {
  font-size: 0.74rem;
  color: #dc2626;
  font-weight: 600;
  min-height: 1em;
}

/* ---------- Dropzone Style File Previews ---------- */
.dhib-dropzone {
  position: relative;
  border: 1.5px dashed #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.85rem;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.dhib-dropzone.is-dragover,
.dhib-dropzone:hover {
  border-color: var(--dhib-teal);
  background: var(--dhib-teal-soft);
}

.dhib-dropzone input[type="file"] {
  width: 100%;
  min-height: 44px;
  border: none;
  background: transparent;
  padding: 0.25rem 0;
}

.dhib-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.dhib-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  padding: 0.38rem 0.6rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--dhib-ink);
}

.dhib-file-item.is-too-big {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.dhib-file-hint {
  font-size: 0.73rem;
  color: var(--dhib-muted);
  margin-top: 0.35rem;
}

/* ---------- Payment Account Copy Pills & Conditional Wraps ---------- */
.dhib-pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--dhib-ink);
}

.dhib-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--dhib-teal-dark);
  border-radius: 7px;
  padding: 0.18rem 0.48rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.dhib-copy-btn:hover {
  background: var(--dhib-teal);
  border-color: var(--dhib-teal);
  color: #ffffff;
}

.dhib-is-collapsed {
  display: none !important;
}

/* ---------- Right Sidebar Readiness & Breakdown ---------- */
.dhib-readiness-box {
  background: #f8fafc;
  border: 1px solid var(--dhib-line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin-block-end: 0.85rem;
}

.dhib-readiness-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--dhib-ink);
  margin-block-end: 0.4rem;
}

progress.dhib-readiness-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--dhib-teal);
}

.dhib-addon-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.dhib-addon-tag {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: var(--dhib-teal-soft);
  color: var(--dhib-teal-dark);
  border: 1px solid #99f6e4;
}

.dh-mt-btn-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ---------- Native Top-Layer Quick Auth <dialog> ---------- */
dialog.dhib-auth-dialog {
  width: min(460px, calc(100vw - 2rem));
  max-height: min(90dvh, 680px);
  margin: auto;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  overflow: auto;
}

dialog.dhib-auth-dialog[open] {
  display: block;
}

dialog.dhib-auth-dialog:modal {
  overscroll-behavior: contain;
}

dialog.dhib-auth-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}

.dhib-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.05rem 1.25rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.dhib-dialog-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  color: #0f172a;
}

.dhib-dialog-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}

.dhib-dialog-close:hover {
  background: #e2e8f0;
}

.dhib-dialog-body {
  padding: 1rem 1.25rem 1.25rem;
}

.dhib-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.3rem;
  background: #f1f5f9;
  border-radius: 12px;
  margin-block-end: 1rem;
}

.dhib-auth-tab {
  min-height: 40px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.dhib-auth-tab.is-active {
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.dhib-auth-form:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dhib-auth-form[hidden] {
  display: none;
}

.dhib-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dhib-auth-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.dhib-auth-field input {
  min-height: 44px;
  padding: 0.55rem 0.78rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font: inherit;
  font-size: max(1rem, 1em);
  color: #0f172a;
}

.dhib-auth-field input:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.25);
  border-color: #0d9488;
}

.dhib-pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.dhib-pwd-wrap input {
  width: 100%;
  padding-inline-end: 2.75rem;
}

.dhib-pwd-toggle {
  position: absolute;
  inset-inline-end: 0.4rem;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
}

.dhib-auth-submit {
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: #0d9488;
  color: #ffffff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.dhib-auth-submit:hover {
  background: #0f766e;
}

.dhib-auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.dhib-auth-status {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-block-end: 0.75rem;
}

.dhib-auth-status.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.dhib-auth-status.is-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* ---------- RTL & Responsive Breakpoints ---------- */
body.dh-rtl .dhib-addon-tags {
  justify-content: flex-start;
}

@media (max-width: 991.98px) {
  .dhib-steps-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dhib-dest-intel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .dhib-steps-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dhib-dest-intel {
    grid-template-columns: 1fr;
  }
}
