/*
Maintained by: Vijaya Kumar L (risewithvj)
GitHub: https://github.com/risewithvj
LinkedIn: https://www.linkedin.com/in/vijayakumarl/
*/
/* ============================================================
   THE MA FOI FOUNDATION — Single-file Portal
   style.css
   ============================================================ */

/* Inter via system font stack — no external request needed */
:root {
  --primary: #0D6EFD;
  --primary-dark: #084298;
  --primary-deep: #0A3ED1;
  --primary-light: #3d8bfd;
  --primary-xlight: #cfe2ff;
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --text-dark: #0D1B2A;
  --text-mid: #2C3E50;
  --text-muted: #6C757D;
  --border: #DEE2E6;
  --success: #198754;
  --danger: #DC3545;
  --danger-light: #f8d7da;
  --shadow-sm: 0 2px 8px rgba(13,110,253,0.08);
  --shadow-md: 0 8px 32px rgba(13,110,253,0.14);
  --shadow-lg: 0 16px 48px rgba(13,110,253,0.20);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --t: 0.22s ease;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text-dark); background: var(--bg-white); line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: var(--font); }
select, input { font-family: var(--font); }
.hidden { display: none !important; }
.req { color: var(--danger); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- HEADER ---- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(13,110,253,0.08);
  box-shadow: 0 1px 12px rgba(13,110,253,0.06);
  transition: box-shadow var(--t);
}
.site-header.scrolled { box-shadow: 0 4px 24px rgba(13,110,253,0.11); }
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 100%; gap: 12px;
}

/* ---- LOGO ---- */
.logo-wrap {
  display: flex; align-items: center;
  flex-shrink: 0; max-width: 55%;
  text-decoration: none;
}
.logo-img {
  height: 40px; width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}
.logo-fallback {
  display: none;
  align-items: center;
  gap: 9px;
}
.logo-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
}
.logo-text { display: flex; flex-direction: column; }
.logo-brand { font-size: 14px; font-weight: 700; color: var(--primary-dark); line-height: 1.15; white-space: nowrap; }
.logo-sub   { font-size: 10.5px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.3px; white-space: nowrap; }

/* ---- NAV ---- */
.header-nav {
  display: flex; align-items: center;
  gap: 8px; flex-shrink: 0;
}

/* Admin button hidden on all devices */
.btn-admin-nav { display: none !important; }

.btn-register-nav {
  display: inline-flex; align-items: center;
  padding: 8px 18px; border-radius: 6px;
  font-size: 13px; font-weight: 600; line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; box-shadow: 0 2px 8px rgba(13,110,253,0.28);
  transition: all var(--t); white-space: nowrap; text-decoration: none;
}
.btn-register-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13,110,253,0.38);
}

.btn-reg-short { display: none; }
.btn-reg-full  { display: inline; }

/* ---- HERO ---- */
.hero-section {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; overflow: hidden;
  background: linear-gradient(135deg, #0D1B2A 0%, var(--primary-dark) 50%, var(--primary) 100%);
}
.hero-section::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px; z-index: 1; pointer-events: none;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(8,66,152,0.85) 0%, rgba(13,110,253,0.70) 50%, rgba(8,66,152,0.80) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 80px 24px; max-width: 720px; animation: fadeInUp 0.8s ease both; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.90); font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
  padding: 6px 16px; border-radius: 50px; margin-bottom: 24px; backdrop-filter: blur(8px);
}
.badge-dot { width: 8px; height: 8px; background: #2FE6A6; border-radius: 50%; animation: pulseDot 2s ease-in-out infinite; }
.hero-heading { font-size: clamp(30px, 5vw, 56px); font-weight: 800; color: white; line-height: 1.15; letter-spacing: -0.5px; margin-bottom: 20px; }
.hero-highlight { color: white; }
.hero-desc { font-size: 18px; color: rgba(255,255,255,0.82); line-height: 1.7; margin-bottom: 36px; max-width: 540px; }
.hero-cta-group { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; color: var(--primary-dark); font-weight: 700; border-radius: 50px;
  padding: 16px 32px; font-size: 16px; transition: all var(--t);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.26); background: #e8f0fe; }
.hero-trust { color: rgba(255,255,255,0.80); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.trust-icon { color: #2FE6A6; margin-right: 4px; }
.hero-scroll { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); z-index: 2; }
.scroll-arrow { width: 22px; height: 22px; border-right: 2px solid rgba(255,255,255,0.5); border-bottom: 2px solid rgba(255,255,255,0.5); transform: rotate(45deg); animation: scrollBounce 1.8s ease-in-out infinite; }

/* ---- HIGHLIGHTS ---- */
.highlights-strip { background: white; border-bottom: 1px solid var(--border); padding: 18px 0; box-shadow: var(--shadow-sm); }
.highlights-inner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.highlight-item { display: flex; align-items: center; gap: 12px; padding: 10px 28px; }
.highlight-item strong { display: block; font-size: 13px; font-weight: 700; color: var(--text-dark); }
.highlight-item span  { font-size: 11px; color: var(--text-muted); }
.highlight-icon { display: flex; align-items: center; }
.h-divider { width: 1px; height: 36px; background: var(--border); }

/* ---- FORM SECTION ---- */
.form-section { background: var(--bg-light); padding: 80px 0 100px; }
.form-container { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.form-left { padding-top: 16px; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.form-heading { font-size: clamp(24px, 3vw, 36px); font-weight: 800; color: var(--text-dark); line-height: 1.2; margin-bottom: 14px; }
.text-accent { color: var(--primary); }
.form-intro { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.program-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0; }
.program-pill {
  display: flex; align-items: center; gap: 6px;
  background: white; border: 1.5px solid var(--border); border-radius: 50px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--text-mid);
  transition: all var(--t); cursor: default; box-shadow: var(--shadow-sm);
}
.program-pill:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---- WHO SHOULD APPLY ---- */
.who-section { margin-top: 8px; }
.who-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--primary);
  margin-bottom: 10px;
}
.who-title {
  font-size: 22px; font-weight: 800;
  color: var(--text-dark); line-height: 1.25;
  letter-spacing: -0.3px; margin-bottom: 20px;
}
.who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.who-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 6px;
  transition: all var(--t);
  cursor: default;
  box-shadow: 0 1px 4px rgba(13,110,253,0.06);
  position: relative; overflow: hidden;
}
.who-tile::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t);
}
.who-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-xlight); }
.who-tile:hover::after { transform: scaleX(1); }
.who-tile-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  transition: transform var(--t);
}
.who-tile:hover .who-tile-icon { transform: scale(1.08); }
.who-tile strong { font-size: 13.5px; font-weight: 700; color: var(--text-dark); line-height: 1.2; }
.who-tile span   { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.who-footer {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--primary);
  background: var(--primary-xlight);
  padding: 10px 14px; border-radius: var(--radius-sm);
}

/* ---- FORM CARD ---- */
.form-card { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid rgba(13,110,253,0.08); overflow: hidden; }
.form-card-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); padding: 26px 32px; color: white; }
.form-card-header h3 { font-size: 19px; font-weight: 700; margin-bottom: 3px; }
.form-card-header p  { font-size: 13px; opacity: 0.8; }
#registrationForm { padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.form-input, .form-select {
  width: 100%; padding: 12px 15px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-dark); background: var(--bg-light);
  transition: all var(--t); outline: none; -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(13,110,253,0.10); }
.form-input.error, .form-select.error { border-color: var(--danger); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer;
}
.field-error { font-size: 12px; color: var(--danger); font-weight: 500; display: none; }
.field-error.show { display: block; }

.phone-wrap { display: flex; align-items: stretch; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: all var(--t); background: var(--bg-light); }
.phone-wrap:focus-within { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(13,110,253,0.10); }
.phone-wrap.error { border-color: var(--danger); }
.phone-prefix { display: flex; align-items: center; padding: 0 13px; background: rgba(13,110,253,0.06); border-right: 1.5px solid var(--border); font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.phone-input { border: none !important; background: transparent !important; box-shadow: none !important; border-radius: 0 !important; flex: 1; }

.captcha-wrap { display: flex; align-items: center; gap: 10px; }
.captcha-code {
  min-width: 96px; text-align: center; padding: 10px 14px;
  background: var(--primary-xlight); color: var(--primary-dark);
  font-family: 'Courier New', monospace; font-weight: 800; font-size: 18px; letter-spacing: 4px;
  border-radius: var(--radius-sm); border: 1.5px dashed var(--primary-light);
  user-select: none; -webkit-user-select: none;
}
.captcha-refresh {
  width: 40px; height: 40px; flex-shrink: 0; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-light); color: var(--primary); font-size: 17px; cursor: pointer;
  transition: all var(--t);
}
.captcha-refresh:hover { background: var(--primary-xlight); border-color: var(--primary); transform: rotate(60deg); }
.captcha-input { flex: 1; min-width: 0; }

.btn-submit {
  width: 100%; padding: 15px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-size: 16px; font-weight: 700; border-radius: var(--radius-sm);
  transition: all var(--t); box-shadow: 0 4px 16px rgba(13,110,253,0.30);
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13,110,253,0.40); }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }
.form-privacy { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: -4px; display: flex; align-items: center; justify-content: center; gap: 5px; }

/* ---- SUCCESS CARD ---- */
.success-card {
  background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(25,135,84,0.12); padding: 56px 40px; text-align: center;
  animation: successPop 0.5s cubic-bezier(0.175,0.885,0.32,1.275) both;
}
.check-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.check-svg { width: 80px; height: 80px; }
.check-circle { stroke: var(--success); stroke-width: 2; stroke-dasharray: 166; stroke-dashoffset: 166; animation: strokeDraw 0.6s ease forwards 0.1s; }
.check-tick { stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: strokeDraw 0.4s ease forwards 0.65s; }
.success-title { font-size: 32px; font-weight: 800; color: var(--text-dark); margin-bottom: 10px; }
.success-msg   { font-size: 17px; font-weight: 600; color: var(--success); margin-bottom: 10px; }
.success-sub   { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 28px; max-width: 340px; margin-left: auto; margin-right: auto; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px;
  background: white; border: 2px solid var(--primary); color: var(--primary);
  font-size: 14px; font-weight: 700; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--t);
}
.btn-secondary:hover { background: var(--primary); color: white; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13,110,253,0.25); }

/* ---- SUCCESS SUMMARY ---- */
.success-summary {
  background: var(--bg-light); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px;
  margin-bottom: 24px; text-align: left; width: 100%;
}
.success-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.success-summary-row:last-child { border-bottom: none; }
.success-summary-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; }
.success-summary-value { font-size: 13.5px; font-weight: 600; color: var(--text-dark); text-align: right; word-break: break-all; }

/* ---- FOOTER ---- */
.site-footer { background: linear-gradient(135deg, #0D1B2A, var(--primary-dark)); color: white; padding: 44px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 28px; }
.footer-logo { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.footer-tag  { font-size: 13px; color: rgba(255,255,255,0.6); max-width: 260px; }
.footer-copy { text-align: right; font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.8; }
.footer-powered { color: rgba(255,255,255,0.4) !important; font-size: 12px; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 99999;
  background: white; border-radius: var(--radius-md); padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15); border-left: 4px solid var(--primary);
  font-size: 14px; font-weight: 500; color: var(--text-dark);
  transform: translateX(130%); transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
  display: flex; align-items: center; gap: 10px; max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.t-success { border-left-color: var(--success); }
.toast.t-error   { border-left-color: var(--danger); }

/* ---- LOADING SKELETON ---- */
.skeleton-wrap { padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.skeleton-line {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.tall   { height: 44px; border-radius: var(--radius-sm); }

/* ---- KEYFRAMES ---- */
@keyframes fadeInUp    { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn      { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp     { from { opacity:0; transform:translateY(24px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes spin        { to { transform:rotate(360deg); } }
@keyframes pulseDot    { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.4);opacity:0.6;} }
@keyframes scrollBounce{ 0%,100%{transform:rotate(45deg) translateY(0);opacity:1;} 50%{transform:rotate(45deg) translateY(6px);opacity:0.5;} }
@keyframes successPop  { from{opacity:0;transform:scale(0.85);} to{opacity:1;transform:scale(1);} }
@keyframes strokeDraw  { to{stroke-dashoffset:0;} }
@keyframes shimmer     { 0%{background-position:-400px 0} 100%{background-position:400px 0} }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- Tablet: 768px – 1023px ---- */
@media(max-width:1023px){
  .logo-img   { max-width: 150px; height: 36px; }
  .logo-brand { font-size: 13px; }
  .logo-sub   { font-size: 10px; }
}

/* ---- Mobile: ≤ 767px ---- */
@media(max-width:767px){
  :root { --header-h: 58px; }

  .header-inner { padding: 0 16px; gap: 8px; }

  .logo-img   { height: 32px; max-width: 130px; }
  .logo-icon  { width: 30px; height: 30px; font-size: 13px; border-radius: 7px; }
  .logo-brand { font-size: 12.5px; }
  .logo-sub   { display: none; }

  .header-nav       { gap: 6px; }
  .btn-register-nav { padding: 7px 13px; font-size: 12px; border-radius: 5px; }
  .btn-reg-full     { display: none; }
  .btn-reg-short    { display: inline; }

  /* Hero */
  .hero-section  { min-height: 60vh; }
  .hero-content  { padding: 48px 16px; }
  .hero-desc     { font-size: 15px; }
  .hero-scroll   { display: none; }

  /* Form layout — show left panel on mobile */
  .form-container    { grid-template-columns: 1fr; }
  .form-left         { display: block; margin-bottom: 24px; }
  .who-grid          { grid-template-columns: 1fr 1fr; }
  .success-card      { grid-column: 1; }
  #registrationForm  { padding: 20px 16px; }
  .form-card-header  { padding: 18px 16px; }

  /* Other */
  .highlights-strip  { display: none; }
  .footer-inner      { flex-direction: column; }
  .footer-copy       { text-align: left; }
  .success-summary   { padding: 12px 14px; }
}

/* ---- Small mobile: ≤ 400px ---- */
@media(max-width:400px){
  .logo-img     { max-width: 110px; }
  .logo-brand   { font-size: 12px; }
  .hero-content { padding: 48px 16px; }
  .who-grid     { grid-template-columns: 1fr; }
}

/* ---- Reduced motion ---- */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after { animation-duration:0.01ms!important; transition-duration:0.01ms!important; }
  .btn-spinner { animation: spin 1.5s linear infinite; }
}