/* ==========================================================================
   EnglishVerse UI layer
   Loaded after style.min.css on every public page (base.html / base_ar.html).
   Holds shared components: header, floating actions, forms, flash messages,
   course cards, trust strip and responsive spacing fixes.
   ========================================================================== */

:root {
  --ev-primary: #1059D6;
  --ev-primary-dark: #0b46ad;
  --ev-primary-soft: #eaf1fd;
  --ev-secondary: #F14D5D;
  --ev-dark: #120F2D;
  --ev-text: #3f4354;
  --ev-muted: #6B6A75;
  --ev-border: #dde3ee;
  --ev-whatsapp: #25D366;
  --ev-success: #15803d;
  --ev-danger: #c62839;
  --ev-radius: 14px;
  --ev-radius-sm: 10px;
  --ev-shadow: 0 10px 30px rgba(18, 15, 45, .08);
  --ev-topbar-h: 40px;
}

/* ---------- Accessibility ---------- */
.ev-skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10000;
  background: var(--ev-dark); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-weight: 600; transition: top .15s;
}
.ev-skip-link:focus { top: 12px; color: #fff; }

a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(16, 89, 214, .55);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Header ---------- */
.ev-topbar { min-height: var(--ev-topbar-h); }
.ev-topbar a:hover { color: #fff !important; opacity: .85; }

.ev-logo { height: 64px; width: auto; display: block; }

.ev-navbar .navbar-brand { padding: 8px 0; }
.ev-navbar .ev-nav-cta { white-space: nowrap; border-radius: 50px; font-weight: 600; }
.ev-navbar .navbar-toggler { border: 1px solid var(--ev-border); border-radius: 10px; padding: 8px 10px; }
.ev-navbar .dropdown-item { padding: .55rem 1.25rem; font-family: 'Jost', sans-serif; font-weight: 500; color: var(--ev-dark); }
.ev-navbar .dropdown-item:hover, .ev-navbar .dropdown-item:focus { background: var(--ev-primary-soft); color: var(--ev-primary); }
.ev-navbar .dropdown-item.active, .ev-navbar .dropdown-item:active { background: var(--ev-primary); color: #fff; }
.ev-navbar .dropdown-divider { margin: .35rem 0; }

@media (min-width: 992px) {
  /* Keep the main nav (and its CTA) in view while scrolling; the top bar scrolls away. */
  .ev-header { position: sticky; top: calc(-1 * var(--ev-topbar-h)); z-index: 1030; }
  .ev-topbar { height: var(--ev-topbar-h); }
  .ev-navbar { box-shadow: 0 2px 14px rgba(18, 15, 45, .06); }
  .ev-navbar .navbar-nav .nav-link { padding-top: 28px; padding-bottom: 28px; font-size: 17px; }
}

@media (max-width: 991.98px) {
  .ev-logo { height: 48px; }
  .ev-navbar { padding-top: 6px !important; padding-bottom: 6px !important; }
  .ev-navbar .navbar-collapse { padding: 8px 4px 16px; border-top: 1px solid #eef1f6; margin-top: 8px; }
  .ev-navbar .navbar-nav .nav-link { padding: 12px 8px; border-bottom: 1px solid #f2f4f8; }
  .ev-navbar .dropdown-menu { box-shadow: none !important; padding: 0 0 0 12px; }
  [dir="rtl"] .ev-navbar .dropdown-menu { padding: 0 12px 0 0; }
  .ev-mobile-ctas { display: flex; gap: 10px; margin-top: 14px; }
  .ev-mobile-ctas .btn { flex: 1; border-radius: 50px; font-weight: 600; padding: 12px 10px; }
}

@media (max-width: 575.98px) {
  .ev-topbar .row { padding-top: 6px !important; padding-bottom: 6px !important; }
}

/* ---------- Page headers (inner pages) ---------- */
.jumbotron.page-header { margin-bottom: 64px !important; }
.jumbotron.page-header .display-1,
.jumbotron.page-header .display-3,
.jumbotron.page-header h1 { font-size: clamp(2.1rem, 4.6vw, 4rem); font-weight: 700; line-height: 1.15; }
/* Long breadcrumb trails (e.g. article titles) must wrap instead of widening the page. */
.jumbotron .d-inline-flex { flex-wrap: wrap; justify-content: center; max-width: 100%; row-gap: 4px; }
.jumbotron .d-inline-flex p { overflow-wrap: anywhere; }

@media (max-width: 767.98px) {
  .jumbotron.page-header { margin-bottom: 40px !important; }
  .jumbotron.page-header .container { padding-top: 1.5rem !important; padding-bottom: 2.5rem !important; }
  .jumbotron.page-header .d-inline-flex { margin-bottom: 1.5rem !important; font-size: .85rem; }
  footer > .overlay-top { margin-top: 48px !important; }
}

/* ---------- Floating actions (WhatsApp + back to top) ---------- */
.ev-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 1040;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
[dir="rtl"] .ev-fab { right: auto; left: 20px; }
.ev-fab-whatsapp {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ev-whatsapp); color: #fff !important;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); transition: transform .2s ease;
}
.ev-fab-whatsapp:hover { transform: scale(1.06); text-decoration: none; }
.ev-fab-whatsapp i { font-size: 32px; line-height: 1; }
.ev-fab .back-to-top {
  position: static !important; width: 44px; height: 44px; border-radius: 50% !important;
  display: none; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 4px 12px rgba(16, 89, 214, .3);
}
.ev-fab .back-to-top.is-visible { display: flex !important; }
/* Leave room for the sticky "Enroll" bars on course pages (mobile). */
@media (max-width: 991.98px) {
  body:has(.mobile-sticky-enroll) .ev-fab { bottom: 92px; }
  /* The enrolment form already links to WhatsApp; keep its inputs unobstructed. */
  body:has(#enrollmentForm) .ev-fab { display: none; }
}
@media (max-width: 575.98px) {
  .ev-fab { right: 14px; bottom: 14px; }
  [dir="rtl"] .ev-fab { left: 14px; }
  .ev-fab-whatsapp { width: 52px; height: 52px; }
  .ev-fab-whatsapp i { font-size: 28px; }
}

/* ---------- Flash messages ---------- */
.ev-flash-stack {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1060; width: min(560px, calc(100% - 24px));
  display: flex; flex-direction: column; gap: 10px;
}
.ev-flash {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 12px 34px rgba(18, 15, 45, .18);
  border-left: 5px solid var(--ev-primary); color: var(--ev-text);
  animation: ev-flash-in .25s ease-out;
}
[dir="rtl"] .ev-flash { border-left: 0; border-right: 5px solid var(--ev-primary); text-align: right; }
.ev-flash.is-success { border-color: var(--ev-success); }
.ev-flash.is-error { border-color: var(--ev-danger); }
.ev-flash .ev-flash-icon { font-size: 1.25rem; line-height: 1.4; }
.ev-flash.is-success .ev-flash-icon { color: var(--ev-success); }
.ev-flash.is-error .ev-flash-icon { color: var(--ev-danger); }
.ev-flash p { margin: 0; flex: 1; font-size: .95rem; line-height: 1.5; }
.ev-flash-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: #8a8f9c; padding: 0 2px; cursor: pointer; }
.ev-flash.is-hiding { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
@keyframes ev-flash-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Forms ---------- */
.ev-form label, .ev-label { font-weight: 600; font-size: .92rem; color: var(--ev-dark); margin-bottom: 6px; }
.ev-form .ev-optional { font-weight: 400; color: var(--ev-muted); font-size: .82rem; }
.ev-form .form-control {
  height: 52px; padding: .65rem 1rem; border: 1px solid var(--ev-border);
  border-radius: var(--ev-radius-sm); background-color: #fff; color: var(--ev-dark);
  font-size: 1rem; box-shadow: none;
}
.ev-form select.form-control { padding-right: 2rem; }
[dir="rtl"] .ev-form select.form-control { padding-right: 1rem; padding-left: 2rem; }
.ev-form textarea.form-control { height: auto; min-height: 110px; }
.ev-form .form-control::placeholder { color: #9aa1b0; }
.ev-form .form-control:focus { border-color: var(--ev-primary); box-shadow: 0 0 0 .2rem rgba(16, 89, 214, .15); }
.ev-form.was-validated .form-control:invalid, .ev-form .form-control.is-invalid { border-color: var(--ev-danger); }
.ev-form.was-validated .form-control:invalid:focus { box-shadow: 0 0 0 .2rem rgba(198, 40, 57, .15); }
.ev-form .invalid-feedback { font-size: .82rem; }
.ev-form.was-validated .form-control:invalid ~ .invalid-feedback { display: block; }
.ev-form .ev-hint { font-size: .8rem; color: var(--ev-muted); margin-top: 4px; }
.ev-form .ev-submit { border-radius: 50px; font-weight: 700; padding: 14px 28px; font-size: 1.05rem; }
.ev-form .ev-submit[disabled] { opacity: .8; cursor: progress; }
.ev-form .ev-privacy { font-size: .8rem; color: var(--ev-muted); }
/* Honeypot: hidden without negative offsets (those create horizontal scroll in RTL). */
.ev-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Choice chips (radio buttons styled as pills) */
.ev-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-chip { position: relative; margin: 0; }
.ev-chip input { position: absolute; opacity: 0; inset: 0; }
.ev-chip span {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--ev-border); border-radius: 50px;
  font-size: .9rem; font-weight: 600; color: var(--ev-text); background: #fff; cursor: pointer; transition: all .15s;
}
.ev-chip input:checked + span { background: var(--ev-primary); border-color: var(--ev-primary); color: #fff; }
.ev-chip input:focus-visible + span { outline: 3px solid rgba(16, 89, 214, .45); outline-offset: 2px; }

/* Enquiry card */
.ev-enquiry {
  background: #fff; border-radius: 20px; box-shadow: var(--ev-shadow);
  padding: 32px; color: var(--ev-text); text-align: left;
}
[dir="rtl"] .ev-enquiry { text-align: right; }
.ev-enquiry h2, .ev-enquiry .ev-enquiry-title { color: var(--ev-dark); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 6px; }
.ev-enquiry .ev-enquiry-sub { color: var(--ev-muted); margin-bottom: 22px; }
.ev-enquiry-perks { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ev-enquiry-perks li { font-size: .9rem; font-weight: 600; color: var(--ev-dark); }
.ev-enquiry-perks i { color: var(--ev-success); margin-right: 6px; }
[dir="rtl"] .ev-enquiry-perks i { margin-right: 0; margin-left: 6px; }
@media (max-width: 575.98px) { .ev-enquiry { padding: 22px 18px; border-radius: 16px; } }

.ev-enquiry-section { padding: 72px 0; background: linear-gradient(180deg, var(--ev-primary-soft) 0%, #fff 100%); }
@media (max-width: 767.98px) { .ev-enquiry-section { padding: 40px 0; } }

/* ---------- Hero (homepage) ---------- */
.ev-hero-sub { color: rgba(255, 255, 255, .92); font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 720px; margin: 0 auto 26px; line-height: 1.55; }
.ev-hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 22px; }
.ev-hero-ctas .btn { border-radius: 50px; font-weight: 700; padding: 15px 30px; font-size: 1.05rem; }
.ev-btn-cta { background: var(--ev-secondary); border-color: var(--ev-secondary); color: #fff; box-shadow: 0 8px 24px rgba(241, 77, 93, .35); }
.ev-btn-cta:hover, .ev-btn-cta:focus { background: #e03547; border-color: #e03547; color: #fff; }
.ev-trust { list-style: none; padding: 0; margin: 0 auto 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; max-width: 860px; }
.ev-trust li { color: #fff; font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.ev-trust i { color: #7dffb3; }
@media (max-width: 575.98px) {
  .ev-hero-ctas .btn { width: 100%; padding: 14px 20px; }
  .ev-trust { flex-direction: column; align-items: flex-start; width: max-content; max-width: 100%; gap: 6px; }
  .ev-hero-search .input-group-prepend .btn { padding-left: 12px !important; padding-right: 12px !important; }
  .ev-hero-search .input-group-append .btn { padding-left: 14px !important; padding-right: 14px !important; }
}

.ev-hero-courses { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ev-hero-courses a {
  background: rgba(255, 255, 255, .14); border: 1.5px solid rgba(255, 255, 255, .4); border-radius: 50px;
  padding: 7px 16px; color: #fff; font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .15s;
}
.ev-hero-courses a:hover, .ev-hero-courses a:focus { background: rgba(255, 255, 255, .28); color: #fff; text-decoration: none; }
@media (max-width: 575.98px) { .ev-hero-courses a { font-size: .85rem; padding: 6px 12px; } }

/* ---------- Course cards ---------- */
/* Placeholder colour so a missing/slow image never collapses the card. */
.courses-list-item { background: linear-gradient(135deg, #1b3f86, var(--ev-dark)); min-height: 260px; border-radius: var(--ev-radius); }
.courses-list-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; color: transparent; }
.courses-list-item .courses-text { border-radius: var(--ev-radius); }
.courses-item .d-block.position-relative { background: linear-gradient(135deg, #1b3f86, var(--ev-dark)); min-height: 250px; }
/* The theme's hover effect slides images down 40px; on the homepage cards that exposed an empty band. */
.courses-item .d-block.position-relative img { margin-top: 0 !important; color: transparent; }
.courses-item:hover .d-block.position-relative img { transform: scale(1.05); }
.ev-course-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ev-price-tag { font-weight: 700; color: var(--ev-dark); }
.ev-price-tag small { font-weight: 600; color: var(--ev-muted); }
.ev-price-old { text-decoration: line-through; color: #9aa1b0; font-size: .85em; margin-left: 4px; }

/* "Not sure which course?" helper band */
.ev-helper {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--ev-dark); color: #fff; border-radius: 20px; padding: 28px 32px;
}
.ev-helper h2, .ev-helper h3 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 0 0 4px; }
.ev-helper p { margin: 0; color: rgba(255, 255, 255, .78); }
.ev-helper .btn { border-radius: 50px; font-weight: 700; padding: 12px 24px; }
.ev-helper-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 575.98px) { .ev-helper { padding: 22px 18px; } .ev-helper-actions, .ev-helper-actions .btn { width: 100%; } }

/* ---------- Testimonials ---------- */
.ev-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ev-primary-soft); color: var(--ev-primary); font-family: 'Jost', sans-serif; font-weight: 700; font-size: 1.35rem;
}

/* ---------- Footer CTA ---------- */
.ev-footer-cta .btn { border-radius: 50px; font-weight: 600; padding: 12px 22px; }
.ev-footer-cta p { color: #c9c9d6; }
footer a.text-white-50:hover { color: #fff !important; text-decoration: none; }

/* ---------- Misc responsive fixes ---------- */
.ev-stat h2, .ev-stat .h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.ev-stat p.text-uppercase { font-weight: 700; margin-bottom: 0; line-height: 1.2; }
@media (max-width: 575.98px) {
  .btn-icon { width: 60px; height: 60px; }
  .btn-icon .fa-2x { font-size: 1.5em; }
  /* Contact info boxes (home/about): long email addresses must wrap on very small phones. */
  .bg-light.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
  .mt-n1 p, .mt-n1 h3 { overflow-wrap: anywhere; }
}
