/*
  Site-wide readability and interaction layer.
  Loaded last (after each page's own styles), so the rules here keep every page consistent:
  one font, comfortable line spacing, aligned containers and cards, and gentle hover/focus feedback.
*/

:root {
  --site-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --site-green: #229920;
  --site-green-dark: #1b7d19;
  --site-ink: #1c2539;
  --site-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --site-focus: 0 0 0 3px rgba(34, 153, 32, 0.35);
}

/* Theme variables used by the template, the course pages and the per-page styles all point at one font */
html:root {
  --font-body--family: var(--site-font);
  --font-heading--family: var(--site-font);
  --font-button--family: var(--site-font);
}

/* ---------- One font everywhere ---------- */
/* Some sections hard-code Poppins, Segoe UI or system-ui; code samples keep a monospace font. */
body,
body *:not(code):not(pre):not(kbd):not(samp) {
  font-family: var(--site-font) !important;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Line spacing ---------- */
p,
.text:is(p, div),
.course-body p,
.section-description,
.module-content p,
.text-lists li,
.challenge-list li,
.byte-card p,
.byte-track-body p,
.byte-road p {
  line-height: 1.7;
}

p {
  text-wrap: pretty;
}

/* Headings: tighter than body text but never cramped, and never broken in the middle of a word */
h1, h2, h3, h4, h5, h6,
.heading {
  line-height: 1.22;
  letter-spacing: -0.015em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-wrap: balance;
}

.heading:is(.text-120, .text-110, .text-100, .text-90, .text-80, .text-64) {
  line-height: 1.12;
  letter-spacing: -0.025em;
}

/* Small labels (eyebrows, chips, meta) stay on one compact line */
.subheading,
.course-meta span,
.level,
.status,
.job-tags span {
  line-height: 1.4;
}

/* Headings followed by text get a consistent gap */
.section-headings .heading + .text,
.section-headings .heading + p {
  margin-top: 14px;
}

/* ---------- Alignment ---------- */

/* Footer lines up with the page content above it (it used the full screen width) */
@media (min-width: 1200px) {
  .footer-top > .container-fluid,
  .footer-bottom > .container-fluid {
    max-width: 1140px;
    padding-inline: 12px;
  }
}
@media (min-width: 1400px) {
  .footer-top > .container-fluid,
  .footer-bottom > .container-fluid {
    max-width: 1320px;
  }
}

/* "What we offer" cards: four across left too little room for 28px headings ("Developmen-t") */
.multicolumn-card .heading.text-28 {
  font-size: clamp(20px, 1.7vw, 24px);
}

/* Card grids: equal-height cards with their buttons lined up along the bottom */
.course-card .course-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.course-card .course-body .view-btn {
  margin-top: auto;
}

/* Phones: an even 20px gutter, and long words/links wrap instead of running off screen */
@media (max-width: 575px) {
  .container,
  .container-fluid {
    padding-inline: 20px;
  }
  .row {
    --bs-gutter-x: 1.25rem;
  }
  p,
  li {
    overflow-wrap: break-word;
  }
  .heading.text-50 { font-size: 30px; }
  .heading.text-42 { font-size: 28px; }
}

/* ---------- Footer: compact ---------- */
.footer-top {
  padding: 64px 0 44px;
}
.footer-widget .widget-heading {
  margin-bottom: 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}
.footer-widget-brand .footer-logo {
  display: inline-block;
  margin-bottom: 18px;
}
.footer-widget-brand .footer-logo img {
  max-width: 170px;
  height: auto;
}
.footer-widget-brand > p {
  max-width: 34ch;
  margin-bottom: 20px;
  font-size: 15px;
}
.footer-widget .footer-menu {
  gap: 10px;
}
.footer-widget .footer-menu-2col {
  display: grid !important;
  grid-template-columns: repeat(2, max-content);
  gap: 10px 36px;
}
.footer-menu .link,
.footer-contact-list a {
  font-size: 15px;
  line-height: 1.5;
}
.footer-contact-list {
  display: grid;
  gap: 14px;
  margin: 0;
}
.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.footer-contact-list a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  max-width: 30ch;
  transition: color 0.2s;
}
.footer-contact-list a:hover {
  color: #8fe08c;
}
.footer-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  fill: none;
  stroke: #6fd36c;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.footer-bottom {
  padding: 16px 0;
}
.footer-copyright {
  font-size: 14px;
}

/* Desktop: four even columns; tablets: two by two */
@media (min-width: 992px) {
  .footer-custom-row {
    display: grid !important;
    grid-template-columns: 1.25fr 1fr 1fr 1.15fr;
    gap: 40px;
  }
  .footer-custom-row > * {
    width: auto;
    max-width: none !important;
    padding: 0;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .footer-custom-row {
    row-gap: 36px;
  }
}
@media (max-width: 767px) {
  .footer-top {
    padding: 48px 0 32px;
  }
  .footer-custom-row {
    row-gap: 32px;
  }
}

/* ---------- Footer subscribe ---------- */
.footer-subscribe-intro {
  margin-bottom: 14px;
}
.footer-subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 380px;
}
.footer-subscribe input {
  flex: 1 1 200px;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #fff;
  color: var(--site-ink);
  font-size: 15px;
}
.footer-subscribe button {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--site-green);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}
.footer-subscribe button:hover {
  background: var(--site-green-dark);
}
.footer-subscribe button[disabled] {
  opacity: 0.7;
  cursor: progress;
}
.footer-subscribe-status {
  min-height: 1.5em;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #b8f0b6;
}
.footer-subscribe-status.is-error {
  color: #ffb4b4;
}

/* ---------- Interaction ---------- */

html {
  scroll-behavior: smooth;
}

/* In-page links (#faq, #course-content, ...) stop below the floating header */
[id] {
  scroll-margin-top: calc(var(--header-height, 90px) + 24px);
}

::selection {
  background: rgba(34, 153, 32, 0.22);
}

/* Reading progress bar at the top of the window */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 10000;
  pointer-events: none;
  background: linear-gradient(90deg, var(--site-green), #6fd36c);
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll-progress, 0));
}

/* Keyboard users see where they are */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(34, 153, 32, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Form fields: clear focus state */
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--site-green) !important;
  box-shadow: var(--site-focus) !important;
  outline: none;
}

/* Buttons respond to presses (only plain buttons: slider arrows and toggles position themselves with transforms) */
a.button:active,
button.button:active,
button[type="submit"]:active,
.view-btn:active,
.enroll-open-btn:active {
  scale: 0.97;
}
a.button,
button.button,
button[type="submit"],
.view-btn,
.enroll-open-btn {
  transition-property: transform, scale, box-shadow, background-color, color, border-color;
  transition-duration: 0.2s;
}

/* The arrow inside the template's buttons nudges forward on hover */
@media (hover: hover) {
  .button:hover .svg-wrapper,
  .button:hover > svg {
    transform: translate(2px, -2px);
  }
  .button .svg-wrapper,
  .button > svg {
    transition: transform 0.25s var(--site-ease);
  }
}

/* Cards lift gently on hover (devices with a mouse only, so taps don't leave cards stuck) */
.multicolumn-card,
.card-icon-text,
.card-pricing,
.career-card,
.career-highlight-card,
.feature-card,
.learning-item,
.byte-card,
.card-project {
  transition: translate 0.3s var(--site-ease), box-shadow 0.3s var(--site-ease);
}
@media (hover: hover) {
  /* "translate" (not "transform"), so it adds to any transform a card already has */
  .multicolumn-card:hover,
  .card-icon-text:hover,
  .card-pricing:hover,
  .career-card:hover,
  .career-highlight-card:hover,
  .feature-card:hover,
  .learning-item:hover,
  .byte-card:hover {
    translate: 0 -4px;
    box-shadow: 0 14px 34px rgba(28, 37, 57, 0.12);
  }
  .card-project {
    overflow: hidden;
  }
  .card-project img {
    transition: transform 0.6s var(--site-ease);
  }
  .card-project:hover img {
    transform: scale(1.05);
  }
}

/* Header and footer links: animated underline */
@media (hover: hover) {
  .footer-menu a {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--site-ease), color 0.2s;
  }
  .footer-menu a:hover {
    background-size: 100% 1px;
  }
}

/* Scroll reveals: shorter travel than the library default (100px), so content settles quickly */
[data-aos="fade-up"]:not(.aos-animate) { transform: translate3d(0, 28px, 0); }
[data-aos="fade-down"]:not(.aos-animate) { transform: translate3d(0, -28px, 0); }
[data-aos="fade-right"]:not(.aos-animate) { transform: translate3d(-36px, 0, 0); }
[data-aos="fade-left"]:not(.aos-animate) { transform: translate3d(36px, 0, 0); }

/* People who ask their device for less motion get none */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-progress { display: none; }
}

/* ---------- Learning mega menu (desktop) ----------
   It was centered on the "Learning" link, so on laptop screens (1366px) it ran off the left edge.
   Now it is centered on the screen under the full-width header, and never wider than the screen. */
@media (min-width: 992px) {
  .header-floating .mega-parent {
    position: static;
  }
  .header-floating .mega-menu {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: min(1180px, calc(100vw - 48px));
    gap: 24px;
    padding: 30px 32px;
  }
  /* Invisible bridge, so moving the mouse from "Learning" down to the menu doesn't close it */
  .header-floating .mega-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 40px;
  }
}

/* ---------- Contact / enquiry form (#contactForm) ---------- */
#contactForm.contact-form {
  --form-error: #c62828;
  --form-ok: #1b7d19;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: start;
}
#contactForm.contact-form > * {
  width: auto;
}
#contactForm .field-full,
#contactForm .form-button {
  grid-column: 1 / -1;
}
#contactForm .form-button {
  margin-top: 4px;
}
/* On the dark card of the Contact page */
.col-contact-form #contactForm.contact-form {
  --form-error: #ffb4b4;
  --form-ok: #8fe08c;
}
@media (max-width: 575px) {
  #contactForm.contact-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
#contactForm .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
#contactForm .form-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}
#contactForm .form-label .req {
  color: var(--form-error);
}
#contactForm input,
#contactForm select,
#contactForm textarea {
  width: 100%;
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#contactForm textarea {
  min-height: 130px;
  resize: vertical;
}
#contactForm select:invalid,
#contactForm select:has(option[value=""]:checked) {
  color: #8a94a6;
}
#contactForm select option {
  color: #1c2539;
}

/* Fixed +91 prefix in front of the 10-digit number */
#contactForm .phone-group {
  display: flex;
  align-items: stretch;
}
#contactForm .phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(28, 37, 57, 0.15);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #f1f5f9;
  color: #1c2539;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
#contactForm .phone-group input {
  border-radius: 0 10px 10px 0;
  min-width: 0;
}

/* Error and success states */
#contactForm .field-error {
  min-height: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--form-error);
}
#contactForm .field-error:empty {
  display: none;
}
#contactForm .field.has-error input,
#contactForm .field.has-error select,
#contactForm .field.has-error textarea {
  border-color: var(--form-error) !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15) !important;
}
#contactForm .field.has-error .phone-prefix {
  border-color: var(--form-error);
}
#contactForm .field.is-valid input,
#contactForm .field.is-valid select,
#contactForm .field.is-valid textarea {
  border-color: var(--form-ok);
}
#contactForm .field-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
#contactForm .char-count {
  margin-left: auto;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  white-space: nowrap;
}
#contactForm .char-count.is-near {
  color: #b45309;
  opacity: 1;
}
#contactForm .char-count.is-full {
  color: var(--form-error);
  opacity: 1;
  font-weight: 600;
}

/* Result messages */
.success-message {
  padding: 28px 24px;
  border-radius: 14px;
}
.success-message .success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-message:focus {
  outline: none;
}
.success-message .send-another {
  margin-top: 16px;
  padding: 10px 20px;
  border: 1.5px solid #16a34a;
  border-radius: 10px;
  background: #fff;
  color: #15803d;
  font-weight: 600;
  cursor: pointer;
}
.success-message .send-another:hover {
  background: #f0fdf4;
}
.error-message {
  padding: 14px 16px;
  border-radius: 10px;
  text-align: left;
  font-size: 14.5px;
}
/* Labels and counter are light on the dark card of the Contact page */
.col-contact-form #contactForm .form-label,
.col-contact-form #contactForm .char-count:not(.is-near):not(.is-full) {
  color: rgba(255, 255, 255, 0.92);
}
.col-contact-form #contactForm .char-count.is-near {
  color: #fcd34d;
}

/* ---------- Contact page: address on one line (laptops and wider) ----------
   The info column gets a little more room and the form stacks its fields in one column. */
@media (min-width: 1200px) {
  .contact-box .col-contact-content {
    flex: 0 0 57%;
    max-width: 57%;
  }
  .contact-box .col-contact-form {
    flex: 0 0 43%;
    max-width: 43%;
  }
  .col-contact-form #contactForm.contact-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .contact-info-list .card-icon-text {
    max-width: none;
  }
  .contact-info-list .content .text-20 {
    font-size: 17px;
    line-height: 1.5;
  }
  .contact-info-list .content p.text-20 {
    white-space: nowrap;
  }
}
