:root {
  --accent: #D42A2A;
  --accent-dark: #b01f1f;
  --navy: #14056E;
  --text: #020817;
  --muted: #5b6270;
  --light: #F9F8F8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* Top bar */
.topbar { background: var(--accent); color: #fff; font-size: .9rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; min-height: 40px; flex-wrap: wrap; gap: 8px; }
.topbar .social { display: flex; align-items: center; gap: 14px; }
.topbar .social a { font-weight: 600; opacity: .95; }
.topbar .social a:hover, .topbar .links a:hover { opacity: .75; }
.topbar .links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* Header / nav */
.header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 20; }
.header .container { display: flex; align-items: center; justify-content: space-between; min-height: 84px; gap: 20px; }
.logo img { height: 66px; display: block; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a, .nav button.link {
  font: inherit; font-size: .95rem; font-weight: 500; color: var(--text); background: none; border: none; cursor: pointer;
  padding: 9px 14px; border-radius: 8px; transition: .2s;
}
.nav a:hover, .nav button.link:hover { color: var(--accent); }
.nav a.active { background: var(--accent); color: #fff; }
.nav a.cta { background: var(--accent); color: #fff; padding: 12px 22px; margin-left: 8px; }
.nav a.cta:hover { background: var(--accent-dark); color: #fff; }
.nav form { display: inline; }

/* Buttons */
.btn {
  display: inline-block; border: none; cursor: pointer; font: inherit; font-weight: 500;
  padding: 14px 28px; border-radius: 10px; background: var(--accent); color: #fff; transition: .2s; text-align: center;
}
.btn:hover { background: var(--accent-dark); }
.btn-navy { background: var(--navy); }
.btn-navy:hover { background: #0d0447; }
.btn-block { display: block; width: 100%; }
.btn-disabled { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.btn-disabled:hover { background: #e5e7eb; }

/* Hero */
.hero {
  position: relative;
  color: #fff;
  padding: 140px 0 130px;
  overflow: hidden;
  isolation: isolate;
  min-height: clamp(420px, 72vh, 640px);
  display: flex;
  align-items: center;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero-photo {
  position: absolute;
  inset: -4%;
  background: url("img/hero.jpg") center/cover no-repeat;
  transform-origin: center center;
  animation: heroKen 22s ease-in-out infinite alternate;
  will-change: transform;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2,8,23,.82) 0%, rgba(2,8,23,.55) 42%, rgba(2,8,23,.22) 72%, rgba(2,8,23,.12) 100%),
    linear-gradient(180deg, rgba(2,8,23,.18) 0%, transparent 35%, rgba(2,8,23,.28) 100%);
}
.hero-glow {
  position: absolute;
  width: 48vmax;
  height: 48vmax;
  right: -12%;
  top: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,42,42,.28) 0%, rgba(212,42,42,.08) 42%, transparent 70%);
  animation: heroGlow 10s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero-drift {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(0.2px);
  opacity: .55;
}
.hero-drift-a {
  width: 180px;
  height: 180px;
  left: 58%;
  top: 22%;
  border: 1px solid rgba(255,255,255,.28);
  animation: heroFloat 14s ease-in-out infinite;
}
.hero-drift-b {
  width: 110px;
  height: 110px;
  left: 72%;
  top: 58%;
  background: rgba(255,255,255,.08);
  animation: heroFloat 11s ease-in-out infinite reverse;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 3.6rem;
  line-height: 1.15;
  font-weight: 500;
  max-width: 720px;
  margin-bottom: 22px;
  animation: heroRise .9s ease both;
}
.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin-bottom: 32px;
  opacity: .95;
  animation: heroRise .9s ease .12s both;
}
.hero-cta {
  animation: heroRise .9s ease .22s both;
  box-shadow: 0 10px 28px rgba(212,42,42,.35);
  transition: transform .25s ease, background .2s ease, box-shadow .25s ease;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(212,42,42,.42);
}

@keyframes heroKen {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-2.2%, 1.2%, 0); }
}
@keyframes heroGlow {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .75; }
  to { transform: translate3d(-6%, 8%, 0) scale(1.12); opacity: 1; }
}
@keyframes heroFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(18px, -22px, 0); }
}
@keyframes heroRise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo, .hero-glow, .hero-drift, .hero h1, .hero p, .hero-cta {
    animation: none !important;
  }
  .hero-photo { inset: 0; transform: none; }
}

/* Page title banner (login) */
.page-banner { background: linear-gradient(90deg, rgba(20,5,110,.92), rgba(20,5,110,.7)), url("img/office.jpg") center/cover; color: #fff; padding: 56px 0; }
.page-banner h1 { font-weight: 500; font-size: 2.2rem; }

/* Messages */
.messages { margin-bottom: 28px; }
.message { padding: 14px 18px; border-radius: 10px; margin-bottom: 10px; font-weight: 500; border-left: 5px solid; }
.message.success { background: #e8f7ee; color: #14532d; border-color: #22c55e; }
.message.error { background: #fdeaea; color: #7f1d1d; border-color: var(--accent); }
.message.info { background: #eef0ff; color: var(--navy); border-color: var(--navy); }

/* Courses */
.section { padding: 80px 0; background: var(--light); }
.section-head { text-align: center; margin-bottom: 48px; }
.eyebrow { color: var(--accent); font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px; font-size: .85rem; }
.section-head h2 { font-size: 2.4rem; font-weight: 500; color: var(--navy); margin-top: 6px; }
.section-head p { color: var(--muted); max-width: 560px; margin: 10px auto 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(2,8,23,.07); display: flex; flex-direction: column; transition: .25s; border-top: 5px solid var(--accent); }
.card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(2,8,23,.13); }
.card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.card-body { padding: 28px 26px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.3rem; font-weight: 500; color: var(--navy); margin-bottom: 10px; }
.card p { color: var(--muted); margin-bottom: 20px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.badge { background: #f1f1f6; color: var(--navy); font-size: .82rem; font-weight: 500; padding: 5px 12px; border-radius: 999px; }
.badge.price { background: #fdeaea; color: var(--accent); }
.badge.full { background: #fee2e2; color: #991b1b; }

/* Auth */
.auth-wrap { background: var(--light); padding: 70px 0; }
.auth-box { max-width: 440px; margin: 0 auto; background: #fff; padding: 36px; border-radius: 16px; box-shadow: 0 6px 20px rgba(2,8,23,.08); border-top: 5px solid var(--accent); }
.auth-box h2 { font-weight: 500; color: var(--navy); margin-bottom: 22px; }
.auth-box form p { margin-bottom: 16px; }
.auth-box label { display: block; font-weight: 500; margin-bottom: 5px; font-size: .92rem; }
.auth-box input { width: 100%; padding: 12px 14px; border: 1px solid #d5d8de; border-radius: 10px; font: inherit; }
.auth-box input:focus { outline: 2px solid rgba(212,42,42,.35); border-color: var(--accent); }
.auth-box .errorlist { color: var(--accent); list-style: none; font-size: .9rem; margin-bottom: 8px; }
.auth-box .helptext { display: none; }

/* Footer */
.footer { background: var(--navy); color: #d8d6ee; padding: 28px 0; text-align: center; font-size: .92rem; }

@media (max-width: 800px) {
  .hero h1 { font-size: 2.3rem; }
  .header .container { flex-direction: column; padding-top: 12px; padding-bottom: 12px; }
  .nav { justify-content: center; }
}

/* Date picker on course cards */
.date-label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.date-select { width: 100%; padding: 12px 14px; border: 1px solid #d5d8de; border-radius: 10px; font: inherit; margin-bottom: 14px; background: #fff; }
.date-select:focus { outline: 2px solid rgba(212,42,42,.35); border-color: var(--accent); }
.date-hint { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }

/* Booking calendar modal */
.cal-overlay { position: fixed; inset: 0; background: rgba(2,8,23,.65); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.cal-overlay[hidden] { display: none; }
.cal-modal { background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 28px 26px 26px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,.35); border-top: 6px solid var(--accent); max-height: 95vh; overflow-y: auto; }
.cal-modal h3 { color: var(--navy); font-weight: 500; font-size: 1.25rem; padding-right: 28px; }
.cal-sub { color: var(--muted); font-size: .9rem; margin: 4px 0 16px; }
.cal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.9rem; line-height: 1; cursor: pointer; color: var(--muted); }
.cal-close:hover { color: var(--accent); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--navy); }
.cal-nav button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #d5d8de; background: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.cal-nav button:hover { border-color: var(--accent); color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; border: none; border-radius: 10px; background: transparent; font: inherit; font-size: .95rem; color: #c3c7cf; cursor: default; }
.cal-day.open { background: #fdeaea; color: var(--accent); font-weight: 600; cursor: pointer; border: 1.5px solid var(--accent); }
.cal-day.open:hover { background: var(--accent); color: #fff; }
.cal-day.sel, .cal-day.sel:hover { background: var(--accent); color: #fff; }
.cal-day.full { background: #f1f1f4; color: #9aa0ab; text-decoration: line-through; }
.cal-legend { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin: 14px 0; flex-wrap: wrap; }
.cal-legend .lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cal-legend .lg.open { background: #fdeaea; border: 1.5px solid var(--accent); }
.cal-legend .lg.sel { background: var(--accent); margin-left: 8px; }
.cal-legend .lg.full { background: #f1f1f4; margin-left: 8px; }
.cal-picked { font-weight: 500; color: var(--navy); margin-bottom: 14px; min-height: 1.6em; }
#calConfirm:disabled { background: #e5e7eb; color: #9aa0ab; cursor: not-allowed; }

/* Social login */
.social-login { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 14px; border: 1px solid #d5d8de; border-radius: 10px; background: #fff; font-weight: 500; transition: .2s; }
.social-btn:hover { border-color: var(--accent); background: #fff7f7; }
.social-icon { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; color: #fff; }
.social-icon.g { background: #4285F4; }
.social-icon.a { background: #000; font-size: 1.05rem; }
.or-divider { text-align: center; position: relative; margin: 6px 0 20px; color: var(--muted); font-size: .85rem; }
.or-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #e3e5ea; }
.or-divider span { position: relative; background: #fff; padding: 0 12px; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: .92rem; }
.auth-switch a { color: var(--accent); font-weight: 500; }
.pending { background: #fff7e6; border-left: 5px solid #f59e0b; padding: 12px 14px; border-radius: 8px; margin-bottom: 20px; font-size: .92rem; }
.pending div { margin-top: 4px; color: var(--navy); font-weight: 500; }
.auth-box .messages { margin-bottom: 16px; }
.auth-box .helptext, .auth-box ul:not(.errorlist) { font-size: .8rem; color: var(--muted); }

/* Certificate block on course cards */
.cert { display: flex; gap: 14px; align-items: center; background: #fffaf0; border: 1px solid #f1e2bd; border-radius: 12px; padding: 12px; margin-bottom: 20px; }
.cert-img { width: 92px; height: 69px; object-fit: cover; border-radius: 8px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.cert-text { font-size: .86rem; line-height: 1.45; color: var(--text); }
.cert-text strong { display: block; color: var(--navy); font-weight: 500; margin-bottom: 2px; }
.cert-text span { color: var(--muted); }

/* Certificate "More details" */
.cert-more { display: inline-block; margin-top: 6px; background: none; border: none; padding: 0; font: inherit; font-size: .84rem; font-weight: 500; color: var(--accent); cursor: pointer; }
.cert-more:hover { text-decoration: underline; }
.cert-modal { max-width: 520px; }
.cert-big { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.cert-big[hidden], .cert-note[hidden], #certBook[hidden] { display: none; }
.cert-note { font-size: .75rem; color: var(--muted); margin: 6px 0 14px; text-align: center; }
.cert-summary { color: var(--text); margin-bottom: 12px; }
.cert-list { list-style: none; margin-bottom: 20px; }
.cert-list li { position: relative; padding: 6px 0 6px 26px; border-bottom: 1px solid #eee; font-size: .92rem; }
.cert-list li::before { content: "\2713"; position: absolute; left: 0; top: 6px; color: #fff; background: var(--accent); width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; display: flex; align-items: center; justify-content: center; }

/* Paynix checkout */
.pay-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
}
.pay-summary, .pay-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 6px 20px rgba(2,8,23,.08);
  border-top: 5px solid var(--accent);
}
.pay-summary h2, .pay-box h2, .pay-result h2 { color: var(--navy); font-weight: 500; margin-bottom: 12px; }
.pay-course { font-weight: 500; margin-bottom: 16px; }
.pay-summary dl div, .pay-result-dl div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #eee; font-size: .95rem;
}
.pay-summary dt, .pay-result-dl dt { color: var(--muted); }
.pay-summary dd, .pay-result-dl dd { font-weight: 500; text-align: right; }
.pay-note { color: var(--muted); font-size: .9rem; margin: 16px 0; }
.pay-sub { color: var(--muted); margin-bottom: 18px; }
.pay-status { margin-top: 16px; font-weight: 500; color: var(--navy); }
.pay-status.error { color: var(--accent); }
.pay-result { max-width: 520px; }
.pay-result-dl { margin: 18px 0 24px; }
#dropin-container { min-height: 120px; }
@media (max-width: 800px) {
  .pay-layout { grid-template-columns: 1fr; }
}
