/*
 * UniDream design fixes (audit/design.md). Loaded after the Porto theme and customization.css,
 * so these rules win over the theme at equal specificity. Colour pairs are WCAG 2.2 AA checked.
 */

:root {
  --ud-navy-950: #081a33;
  --ud-navy-900: #0d2547;
  --ud-navy: #183f72;
  --ud-navy-600: #1f5092;
  --ud-coral: #e8465f;      /* brand: logo, decoration, large text only */
  --ud-coral-600: #d3344d;  /* CTA background (white text 4.81:1), coral text on white (4.81:1) */
  --ud-coral-700: #b92a41;  /* hover/active, small coral text on grey (5.30:1) */
  --ud-wa: #25d366;
  --ud-wa-600: #1da851;
  --ud-ink: #1d2330;
  --ud-text: #4b5563;       /* body text: 7.56:1 on white, 6.62:1 on --ud-bg-soft */
  --ud-muted: #5f6672;      /* secondary text: 5.78:1 on white, 5.07:1 on --ud-bg-soft */
  --ud-line: #dde2ea;
  --ud-bg-soft: #eef0f4;
  --ud-bg-lighter: #fafafc;
  --ud-success: #1e7b4a;
  --ud-danger: #b42318;
  --ud-focus: #183f72;
  --ud-radius-md: 12px;
  --ud-radius-lg: 20px;
  --ud-font: "Poppins", "UD Poppins Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/*
 * Metric-adjusted Arial that stands in for Poppins until the self-hosted Poppins files
 * (components/site/fonts.ts) arrive, so the swap barely moves the text (home hero: CLS 0.14 on
 * slow 4G without it). Values from next/font's generated "Poppins Fallback"; limited to the
 * characters Poppins has (latin + latin-ext), so Cyrillic text keeps falling through to the
 * generic sans-serif at its normal size, as before.
 */
@font-face {
  font-family: "UD Poppins Fallback";
  src: local("Arial"), local("ArialMT");
  ascent-override: 93.62%;
  descent-override: 31.21%;
  line-gap-override: 8.92%;
  size-adjust: 112.16%;
  unicode-range: U+0000-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1EFF, U+2000-206F, U+20A0-20C0, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C7F, U+A720-A7FF, U+FEFF, U+FFFD;
}

/* ---------- Text and contrast (P1-1) ---------- */

/* The theme's body font (main.css: "Poppins", sans-serif) plus the adjusted fallback above. */
body {
  color: var(--ud-text);
  font-family: "Poppins", "UD Poppins Fallback", sans-serif;
}

html .text-default,
html .text-color-default {
  color: var(--ud-text) !important;
}

a {
  color: var(--ud-coral-600);
}

a:hover,
a:focus {
  color: var(--ud-coral-700);
}

html .text-color-primary,
html .text-primary {
  color: var(--ud-coral-600) !important;
}

/* Coral text on the grey sections and page headers. */
html .bg-color-quaternary .text-color-primary,
html .custom-bg-color-lighter-grey .text-color-primary,
html .custom-page-header .breadcrumb a {
  color: var(--ud-coral-700) !important;
}

html .text-color-grey {
  color: var(--ud-muted) !important;
}

/* Primary buttons: white on coral-600 instead of #e8465f (3.84:1). */
html .btn-primary {
  background-color: var(--ud-coral-600);
  border-color: var(--ud-coral-600);
  color: #fff;
}

html .btn-primary:hover:not(.bg-transparent),
html .btn-primary.hover:not(.bg-transparent),
html .btn-primary:focus:not(.bg-transparent),
html .btn-primary:active:not(.bg-transparent),
html .btn-primary.active:not(.bg-transparent) {
  background-color: var(--ud-coral-700) !important;
  border-color: var(--ud-coral-700) !important;
  color: #fff;
}

html .btn-primary.disabled:not(.bg-transparent),
html .btn-primary:disabled:not(.bg-transparent) {
  background-color: var(--ud-coral-600);
  opacity: 0.75;
}

/* Placeholders are examples only, never the label (P0-2). */
html input.form-control::placeholder,
html textarea.form-control::placeholder {
  color: var(--ud-muted);
  opacity: 1;
}

/* Footer copyright and university names were #969696 / weight 200 (P1-1, P1-7). */
.studentCard .font-weight-extralight {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ud-navy);
}

.studentCard .font-weight-extralight i {
  font-style: normal;
}

/* ---------- Focus (P1-2) ---------- */

body a:focus-visible,
body button:focus-visible,
body input:focus-visible,
body select:focus-visible,
body textarea:focus-visible,
body summary:focus-visible,
body [tabindex]:focus-visible {
  outline: 3px solid var(--ud-focus) !important;
  outline-offset: 2px;
}

.bg-color-secondary,
.ud-on-dark,
.ud-hero {
  --ud-focus: #fff;
}

.custom-form-style-1 .form-control:focus,
.ud-form .form-control:focus {
  background: #fff !important;
  border-color: var(--ud-navy) !important;
  box-shadow: 0 0 0 3px rgba(24, 63, 114, 0.25) !important;
}

/* Keyboard users: an open dropdown follows the focus instead of sitting at top:-10000px. */
@media (min-width: 992px) {
  #header .header-nav-main nav > ul > li.dropdown:focus-within > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    top: 100%;
    transform: none;
  }
}

/* ---------- Mobile type and tap targets (P1-3) ---------- */

@media (max-width: 575px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  h1.text-9,
  h1.text-10 {
    font-size: 30px !important;
    line-height: 1.15 !important;
  }

  .breadcrumb {
    font-size: 13px;
  }
}

.custom-social-icons li a {
  width: 44px;
  height: 44px;
  line-height: 44px;
}

/* ---------- Header (P0-1, P1-4, P2-8) ---------- */

.ud-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.ud-header-cta {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.ud-icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ud-bg-soft);
  color: var(--ud-navy) !important;
  font-size: 18px;
  text-decoration: none;
}

#header .header-btn-collapse-nav {
  width: 44px;
  height: 44px;
  margin-left: 8px;
  background: var(--ud-coral-600);
  border-radius: 8px;
}

@media (max-width: 991px) {
  #header .header-top {
    display: none;
  }

  #header .header-nav-main nav > ul > li > a,
  #header .header-nav-main:not(.header-nav-main-mobile-dark) nav > ul > li > a {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 16px;
    text-transform: none;
    color: var(--ud-navy);
    font-weight: 600;
  }

  #header .header-nav-main:not(.header-nav-main-mobile-dark) nav > ul > li > a.active,
  #header .header-nav-main:not(.header-nav-main-mobile-dark) nav > ul > li > a.active:focus,
  #header .header-nav-main:not(.header-nav-main-mobile-dark) nav > ul > li > a.active:hover {
    background: var(--ud-coral-600);
    color: #fff;
  }

  #header .header-nav-main nav > ul li .dropdown-menu li a {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: var(--ud-text);
  }
}

/* ---------- Mobile action bar (P0-1) and WhatsApp button (P1-5) ---------- */

.ud-mbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--ud-line);
  box-shadow: 0 -6px 20px rgba(13, 37, 71, 0.08);
}

.ud-mbar__btn {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--ud-radius-md);
  font: 600 15px/1.1 var(--ud-font);
  text-decoration: none;
  text-align: center;
  padding: 0 8px;
}

.ud-mbar__btn--ghost {
  background: var(--ud-bg-soft);
  color: var(--ud-navy) !important;
}

.ud-mbar__btn--wa {
  background: var(--ud-wa-600);
  color: #fff !important;
}

.ud-mbar__btn--cta {
  background: var(--ud-coral-600);
  color: #fff !important;
}

html .whatsapp-icon {
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 1;
  font-size: 28px;
  background: var(--ud-wa-600);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(18, 140, 126, 0.6);
}

html .whatsapp-icon:hover {
  color: #fff !important;
  transform: scale(1.06);
}

@media (max-width: 991px) {
  body {
    padding-bottom: 72px;
  }

  html .whatsapp-icon {
    display: none !important;
  }
}

/* ---------- Home hero (P0-6, P1-13, #19) ---------- */

.ud-hero .background-image-wrapper {
  overflow: hidden;
}

.ud-hero__picture,
.ud-hero__picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ud-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(13, 37, 71, 0.88) 0%, rgba(13, 37, 71, 0.65) 38%, rgba(13, 37, 71, 0) 68%);
}

.ud-hero__title {
  color: #fff;
  text-shadow: none;
}

.ud-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 8px;
}

.ud-hero__secondary {
  color: #fff !important;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 991px) {
  .ud-hero__scrim {
    background: linear-gradient(180deg, rgba(13, 37, 71, 0.9) 0%, rgba(13, 37, 71, 0.6) 50%, rgba(13, 37, 71, 0.05) 85%);
  }

  .ud-hero__picture img {
    object-position: center 85%;
  }

  .ud-hero .col-sm-9 {
    text-align: left !important;
  }

  .ud-hero__actions {
    justify-content: flex-start;
  }
}

/* The slanted white edges of these home sections are 200% wide pseudo-elements: clip them
   sideways so the page is no wider than the screen (CLAUDE.md #19, design audit P2-5). */
.our-services,
.coaching-consulting {
  overflow-x: clip;
}

/* ---------- Forms (P0-2) ---------- */

.ud-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ud-ink);
}

.ud-label .ud-optional {
  font-weight: 400;
  color: var(--ud-muted);
}

.ud-form .form-control[aria-invalid="true"] {
  border-color: var(--ud-danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15) !important;
}

.ud-form-error {
  color: var(--ud-danger);
  font-size: 14px;
  margin: 0 0 12px;
}

.ud-success {
  text-align: center;
  padding: 24px 8px;
}

.ud-success__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: rgba(30, 123, 74, 0.12);
  color: var(--ud-success);
  font-size: 28px;
}

.ud-success p {
  color: var(--ud-ink);
  font-size: 16px;
  margin-bottom: 20px;
}

.ud-btn {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.ud-btn--wa {
  background: var(--ud-wa-600);
  color: #fff !important;
  border: 0;
}

.ud-btn--wa:hover {
  background: #178a43;
}

.ud-card {
  border: 1px solid var(--ud-line);
  border-radius: var(--ud-radius-lg);
  background: #fff;
  padding: 24px;
  box-shadow: 0 18px 50px -20px rgba(13, 37, 71, 0.25);
}

.ud-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ud-navy);
  margin-bottom: 16px;
}

.ud-nowrap {
  white-space: nowrap;
}

/* ---------- Events (P0-5, P1-11) ---------- */

.ud-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ud-bg-soft);
  color: var(--ud-ink);
  font-size: 13px;
  font-weight: 600;
}

.ud-past-notice {
  background: var(--ud-bg-soft);
  border-radius: var(--ud-radius-lg);
  padding: 24px;
}

.ud-past-notice p {
  color: var(--ud-ink);
}

.ud-event-mobile-media img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 16px;
}

.ud-event-mobile-action {
  margin-top: 8px;
}

/* ---------- About: split halves, team and stories on phones (P1-1, P1-7) ---------- */

.ud-split-left {
  background-color: var(--ud-navy);
}

.ud-split-right {
  background-color: var(--ud-coral-700);
}

@media (max-width: 991px) {
  .ud-team-photo {
    max-width: 200px;
  }
}

@media (max-width: 767px) {
  .ud-story .studentImage {
    width: 100% !important;
    max-height: 300px;
    object-fit: cover;
    object-position: center 25%;
  }
}

/* ---------- Education pages (P1-10) ---------- */

.ud-faq-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--ud-navy);
  margin: 0 0 8px;
}

.custom-accordion-style-1 .accordion-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
}

.custom-accordion-style-1 .accordion-toggle::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.custom-accordion-style-1 .accordion-toggle:not(.collapsed)::after {
  transform: rotate(-135deg);
}

@media (min-width: 768px) {
  .ud-sticky {
    position: sticky;
    top: 110px;
  }
}

.ud-education-hero .ud-hero__scrim {
  background: rgba(13, 37, 71, 0.55);
}

/* The header photo is an <img> now (EducationHero); same placement as the old background. */
.ud-education-hero .ud-hero__picture--top img {
  object-position: center top;
}

.ud-education-hero .ud-hero__picture--center img {
  object-position: center;
}

.ud-education-hero h1,
.ud-education-hero .breadcrumb li {
  text-shadow: none !important;
}

/* ---------- Partners (P1-8) ---------- */

.ud-partners {
  padding: 48px 0;
}

.ud-partners__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ud-muted);
  text-align: center;
  margin-bottom: 24px;
}

.ud-partners__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px 32px;
  align-items: center;
  justify-items: center;
}

.ud-partners__grid img {
  width: auto !important;
  max-width: 100%;
  height: 44px !important;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.8;
  transition: filter 0.2s, opacity 0.2s;
}

.ud-partners__grid li:hover img {
  filter: none;
  opacity: 1;
}

@media (max-width: 575px) {
  .ud-partners__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Footer (P2-3) ---------- */

@media (max-width: 991px) {
  #footer .nav-footer .nav {
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }

  #footer .nav-footer .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ud-partners__grid img,
  html .whatsapp-icon {
    transition: none;
  }
}

/* The white wave at the bottom of the header stays above the scrim. */
.ud-education-hero .shape-divider {
  z-index: 3 !important;
}

.ud-education-hero .breadcrumb li,
.ud-education-hero .breadcrumb li.active,
.ud-education-hero .breadcrumb > li + li::before {
  color: #fff !important;
}

/* Contact links that are tap targets on phones (P1-12). */
.ud-tap {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Headings with Porto's tall line-height utility (2em+) get a normal one on phones. */
@media (max-width: 575px) {
  h2.line-height-9 {
    line-height: 1.2 !important;
  }
}

/* The contact page fields had no border on white (#fafafc fill only). */
.custom-form-style-1 .form-control {
  border: 1.5px solid var(--ud-line) !important;
}

/* Porto sets a serif font on blockquotes (event cards): keep the site font in our components. */
.ud-badge,
.ud-btn,
.ud-success,
.ud-past-notice,
.ud-card {
  font-family: var(--ud-font);
}

/* Service accordion headers (home and /services): a full-height tap target, readable size (P1-9). */
.card-accordion-our-services-container .accordion-toggle {
  display: flex !important;
  align-items: center;
  min-height: 48px;
  font-size: 16px;
}

/* Active / hovered desktop menu item: coral-600 on white (4.81:1, #e8465f was 3.84:1). */
@media (min-width: 992px) {
  html #header .header-nav-main nav > ul > li > a.active,
  html #header .header-nav-main nav > ul > li:hover > a {
    color: var(--ud-coral-600) !important;
  }
}
