/**
 * eCare Academy — admission flow: course-page "ভর্তি হন" CTA, mobile-number popup, phone-first checkout, result pages.
 * Theme CSS on top of Tutor's own classes; nothing in Tutor is edited.
 */

/* Scroll lock keeps the scrollbar visible: see window.ecareScrollLock in ecare-frontend.js */

/* ============================== Course page CTA ============================== */
.ecare-enroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 13px 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ecare-blue), var(--ecare-indigo));
  box-shadow: 0 16px 28px -14px rgba(217, 6, 67, 0.9);
  color: #FFFFFF !important;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ecare-ease, ease), box-shadow 0.25s var(--ecare-ease, ease), filter 0.2s;
}

.ecare-enroll-btn svg { transition: transform 0.25s var(--ecare-ease, ease); }
.ecare-enroll-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 34px -14px rgba(217, 6, 67, 0.95); filter: brightness(1.05); }
.ecare-enroll-btn:hover svg { transform: translateX(4px); }
.ecare-enroll-btn:focus-visible { outline: 3px solid #93C5FD; outline-offset: 3px; }

.ecare-enroll-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ecare-slate);
  font-size: 13px;
}

.ecare-enroll-trust li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.ecare-enroll-trust svg { width: 16px; height: 16px; color: var(--ecare-success); }

/* ============================== Popup ============================== */
.ecare-enroll-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 27, 75, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.ecare-enroll-modal[hidden] { display: none; }
.ecare-enroll-modal.is-open { opacity: 1; }

.ecare-enroll-card {
  position: relative;
  width: min(440px, 100%);
  padding: 28px 28px 22px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 40px 80px -30px rgba(15, 23, 42, 0.6);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.3s var(--ecare-ease, ease);
}

.is-open .ecare-enroll-card { transform: none; }

.ecare-enroll-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #F1F5F9;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ecare-enroll-close:hover { background: #E0E7FF; color: var(--ecare-blue); }

.ecare-enroll-course {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 36px 20px 0;
  padding: 10px 12px;
  border: 1px solid #E8EDF6;
  border-radius: 10px;
  background: #F8FAFF;
}

.ecare-enroll-course img { flex-shrink: 0; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.ecare-enroll-course div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ecare-enroll-course small { color: var(--ecare-slate); font-size: 12px; }
.ecare-enroll-course strong { overflow: hidden; color: var(--ecare-navy, #0B1B4B); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.ecare-enroll-price { color: var(--ecare-blue); font-size: 14px; font-weight: 800; }

.ecare-enroll-card h2 {
  margin: 0 0 6px;
  color: var(--ecare-navy, #0B1B4B);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.ecare-enroll-lead { margin: 0 0 18px; color: #5B6B82; font-size: 14.5px; line-height: 1.6; }

.ecare-enroll-phone {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 2px solid #DDE3EF;
  border-radius: 10px;
  background: #FFFFFF;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ecare-enroll-phone:focus-within { border-color: var(--ecare-blue); box-shadow: 0 0 0 4px rgba(217, 6, 67, 0.14); }
.ecare-enroll-phone span { display: inline-flex; align-items: center; align-self: stretch; padding: 0 14px; border-right: 1px solid #E8EDF6; background: #F8FAFF; }
.ecare-flag { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12); }

.ecare-enroll-phone input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0F172A;
  font-family: var(--ecare-font-en);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ecare-enroll-phone input[aria-invalid="true"] { color: var(--ecare-danger); }
.ecare-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.ecare-enroll-error {
  margin: 10px 2px 0;
  color: var(--ecare-danger);
  font-size: 13.5px;
  font-weight: 600;
}

.ecare-enroll-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ecare-blue), var(--ecare-indigo));
  box-shadow: 0 16px 28px -14px rgba(217, 6, 67, 0.9);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s var(--ecare-ease, ease), filter 0.2s;
}

.ecare-enroll-submit:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.ecare-enroll-submit:disabled { opacity: 0.75; cursor: progress; }
.ecare-enroll-foot { margin: 14px 0 0; color: #94A3B8; font-size: 12.5px; line-height: 1.5; text-align: center; }

/* ============================== Checkout (Tutor native) — compact ============================== */
/* The WordPress page title stays for screen readers/SEO but is visually replaced by the compact head below. */
.ecare-checkout-page .entry-header {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ecare-checkout-page .entry-content,
.ecare-checkout-page article,
.ecare-checkout-page .site-main { margin: 0; padding: 0; }

.tutor-checkout-page { padding: 18px 0 48px; background: transparent; }
.tutor-checkout-page .tutor-container { max-width: 1000px; }

.ecare-co-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.ecare-co-head h2 { margin: 0; color: var(--ecare-navy, #0B1B4B); font-size: 22px; font-weight: 700; line-height: 1.3; }

.ecare-co-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #ECFDF5;
  color: #047857;
  font-size: 12.5px;
  font-weight: 600;
}

/* Two columns: form on the left, sticky summary on the right */
.tutor-checkout-page #tutor-checkout-form > .tutor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  margin: 0 !important;
  --tutor-gutter-x: 0;
  --tutor-gutter-y: 0;
}

.tutor-checkout-page #tutor-checkout-form > .tutor-row > * {
  width: auto;
  max-width: none;
  margin: 0 !important;
  padding: 0 !important;
}

.tutor-checkout-page #tutor-checkout-form > .tutor-row > [tutor-checkout-details] {
  order: 2;
  position: sticky;
  top: 88px;
  align-self: start;
}

.tutor-checkout-page .tutor-checkout-details,
.tutor-checkout-page .tutor-checkout-billing-inner {
  padding: 16px 18px;
  border: 1px solid #E6ECF5;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 12px 26px -22px rgba(15, 23, 42, 0.4);
}

.tutor-checkout-page .tutor-checkout-details * { box-shadow: none; }
.tutor-checkout-page .tutor-checkout-details [class*="tutor-checkout-details-inner"],
.tutor-checkout-page .tutor-checkout-details > div { background: transparent; padding-left: 0; padding-right: 0; border-radius: 0; }

.tutor-checkout-page h5 { margin: 0 0 10px; color: var(--ecare-navy, #0B1B4B); font-size: 15.5px; font-weight: 700; }
.tutor-checkout-page .tutor-checkout-details h5 { padding-top: 0; }
.tutor-checkout-page .tutor-checkout-details-inner { padding: 0 !important; background: transparent !important; }

/* "Already have an account?" becomes a slim inline row */
.tutor-checkout-page .tutor-checkout-billing-inner > div.tutor-mb-32 {
  margin: 0 0 12px !important;
  padding: 8px 10px 8px 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #F5F8FF;
  font-size: 13px;
}

.tutor-checkout-page .tutor-checkout-billing-inner > div.tutor-mb-32 .tutor-btn { min-height: 30px; padding: 4px 12px; border-radius: 8px; font-size: 12.5px; }

/* Phone-first fields */
.ecare-co-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ecare-co-field--wide, .ecare-co-alert { grid-column: 1 / -1; }
.ecare-co-field label { display: block; margin-bottom: 4px; color: #334155; font-size: 13px; font-weight: 600; }
.ecare-co-field abbr { color: #DC2626; text-decoration: none; }
.ecare-co-opt { color: #94A3B8; font-weight: 500; }
.ecare-co-field small { display: block; margin-top: 4px; color: #94A3B8; font-size: 11.5px; line-height: 1.45; }

.ecare-co-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid #DDE3EF;
  border-radius: 10px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 15px;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ecare-co-field input:focus { border-color: var(--ecare-blue); box-shadow: 0 0 0 3px rgba(217, 6, 67, 0.12); outline: 0; }

.ecare-co-phone { display: flex; align-items: center; overflow: hidden; border: 1.5px solid #DDE3EF; border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s; }
.ecare-co-phone:focus-within { border-color: var(--ecare-blue); box-shadow: 0 0 0 3px rgba(217, 6, 67, 0.12); }
.ecare-co-prefix { display: inline-flex; align-items: center; align-self: stretch; padding: 0 11px; border-right: 1px solid #E8EDF6; background: #F8FAFF; }
.ecare-co-phone input { flex: 1; min-width: 0; border: 0; border-radius: 0; font-family: var(--ecare-font-en); font-weight: 600; letter-spacing: 0.03em; box-shadow: none !important; }

.ecare-co-alert { padding: 10px 12px; border: 1px solid #FECACA; border-radius: 10px; background: #FEF2F2; color: var(--ecare-danger); font-size: 13px; font-weight: 600; }

/* Payment methods: logo tiles */
.tutor-checkout-page .tutor-payment-method-wrapper { margin-top: 14px !important; }
.tutor-checkout-page .tutor-checkout-payment-options { margin-bottom: 12px !important; }

.tutor-checkout-payment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 12px !important;
  border: 1.5px solid #DDE3EF;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.tutor-checkout-page .tutor-checkout-payment-item { border: 1.5px solid #DDE3EF !important; background: #FFFFFF !important; }
.tutor-checkout-page .tutor-checkout-payment-item:hover { border-color: #F0A8C9 !important; }
.tutor-checkout-page .tutor-checkout-payment-item:has(input:checked) { border-color: #E2136E !important; background: #FFF6FA !important; box-shadow: 0 0 0 3px rgba(226, 19, 110, 0.1); }
.tutor-checkout-page .tutor-checkout-payment-item .tutor-form-check-input:checked { background-color: #E2136E !important; border-color: #E2136E !important; }

/* The official logo already carries the word "bKash"; the text stays for screen readers only */
.tutor-checkout-page .tutor-checkout-payment-item .tutor-payment-item-content { display: flex; align-items: center; font-size: 0 !important; line-height: 0 !important; color: transparent; }
.tutor-checkout-page .tutor-checkout-payment-item .tutor-payment-item-content img { width: auto !important; height: 30px !important; max-width: 120px !important; object-fit: contain; }

/* Pay button */
#tutor-checkout-pay-now-button {
  min-height: 48px;
  margin-top: 12px !important;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ecare-blue), var(--ecare-indigo));
  box-shadow: 0 14px 24px -14px rgba(217, 6, 67, 0.9);
  font-size: 16px;
  font-weight: 700;
}

#tutor-checkout-pay-now-button:hover:not(:disabled) { filter: brightness(1.06); }
.ecare-co-trust { margin: 10px 0 0; color: var(--ecare-slate); font-size: 12px; line-height: 1.5; text-align: center; }

/* Order summary: tighter rows */
.tutor-checkout-page .tutor-checkout-details .tutor-fs-6, .tutor-checkout-page .tutor-checkout-details .tutor-fs-7 { line-height: 1.4; }
.tutor-checkout-page .tutor-checkout-details hr, .tutor-checkout-page .tutor-checkout-details .tutor-divider { margin: 10px 0; }

/* ============================== Result pages ============================== */
.ecare-order-done { max-width: 620px; margin: 48px auto 80px; padding: 32px 26px; border: 1px solid #E6ECF5; border-radius: 16px; background: #FFFFFF; box-shadow: 0 30px 60px -36px rgba(15, 23, 42, 0.4); text-align: center; }

.ecare-pw-card {
  margin: 26px 0;
  padding: 20px;
  border: 1px solid #DDE7FF;
  border-radius: 12px;
  background: #F5F8FF;
  text-align: left;
}

.ecare-pw-card h3 { margin: 0 0 6px; color: var(--ecare-navy, #0B1B4B); font-size: 17px; font-weight: 700; }
.ecare-pw-card p { margin: 0 0 12px; color: #475569; font-size: 14px; }
.ecare-pw-row { display: flex; gap: 10px; }
.ecare-pw-row input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 1.5px solid #DDE3EF; border-radius: 10px; font-size: 15px; }
.ecare-pw-error { color: var(--ecare-danger) !important; font-weight: 600; }
.ecare-pw-ok { margin: 20px 0; padding: 12px 14px; border-radius: 12px; background: #ECFDF5; color: #047857; font-size: 14px; font-weight: 600; }

@media (max-width: 820px) {
  .tutor-checkout-page #tutor-checkout-form > .tutor-row { grid-template-columns: 1fr; }
  .tutor-checkout-page #tutor-checkout-form > .tutor-row > [tutor-checkout-details] { order: 0; position: static; }
}

@media (max-width: 600px) {
  .ecare-enroll-modal { align-items: flex-end; padding: 0; }
  .ecare-enroll-card { width: 100%; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; transform: translateY(40px); }
  .ecare-co-fields { grid-template-columns: 1fr; }
  .tutor-checkout-page .tutor-checkout-details,
  .tutor-checkout-page .tutor-checkout-billing-inner { padding: 14px; }
  .ecare-pw-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .ecare-enroll-modal, .ecare-enroll-card, .ecare-enroll-btn, .ecare-enroll-submit { transition: none; }
}
