
/* ============================================================
   MALTA TUTORS V41 — FOUR MODE VISUAL SYSTEM
   Modes: light | dark | colorful | corporate
   ============================================================ */

:root{
  --mt41-bg:#f8fbff;
  --mt41-surface:rgba(255,255,255,.84);
  --mt41-surface-solid:#ffffff;
  --mt41-text:#0d1430;
  --mt41-muted:#687189;
  --mt41-border:rgba(92,105,160,.14);
  --mt41-primary:#6757f6;
  --mt41-secondary:#2e84ff;
  --mt41-accent:#1ecae7;
  --mt41-accent2:#5fe0bf;
  --mt41-accent3:#ff73b8;
  --mt41-dark:#0a1028;
  --mt41-shadow:0 25px 75px rgba(28,37,98,.12);
  --mt41-shadow-xl:0 55px 145px rgba(15,23,75,.22);
  --mt41-radius:24px;
  --mt41-grid:rgba(46,132,255,.028);
  --mt41-hero1:rgba(103,87,246,.22);
  --mt41-hero2:rgba(30,202,231,.20);
  --mt41-hero3:rgba(255,115,184,.08);
  --mt41-hero-end:#edf8ff;
  --mt41-dark-section:#0b1130;
  --mt41-dark-section2:#153a58;
  --mt41-footer:#070c1f;
}

html[data-theme="dark"]{
  --mt41-bg:#050817;
  --mt41-surface:rgba(15,21,49,.78);
  --mt41-surface-solid:#101733;
  --mt41-text:#f6f8ff;
  --mt41-muted:#a6b0c9;
  --mt41-border:rgba(255,255,255,.10);
  --mt41-primary:#8a68ff;
  --mt41-secondary:#448dff;
  --mt41-accent:#25d6f1;
  --mt41-accent2:#62ead0;
  --mt41-accent3:#ff77c2;
  --mt41-dark:#050817;
  --mt41-shadow:0 25px 80px rgba(0,0,0,.35);
  --mt41-shadow-xl:0 55px 150px rgba(0,0,0,.48);
  --mt41-grid:rgba(255,255,255,.025);
  --mt41-hero1:rgba(117,92,255,.38);
  --mt41-hero2:rgba(31,213,239,.30);
  --mt41-hero3:rgba(255,115,190,.13);
  --mt41-hero-end:#08112a;
  --mt41-dark-section:#040714;
  --mt41-dark-section2:#102341;
  --mt41-footer:#03050e;
}

html[data-theme="colorful"]{
  --mt41-bg:#fff8ff;
  --mt41-surface:rgba(255,255,255,.86);
  --mt41-surface-solid:#ffffff;
  --mt41-text:#1b1033;
  --mt41-muted:#705d83;
  --mt41-border:rgba(115,73,170,.13);
  --mt41-primary:#7b35ff;
  --mt41-secondary:#007cff;
  --mt41-accent:#00c8e6;
  --mt41-accent2:#2dd4a9;
  --mt41-accent3:#ff2f93;
  --mt41-dark:#241044;
  --mt41-grid:rgba(123,53,255,.03);
  --mt41-hero1:rgba(123,53,255,.26);
  --mt41-hero2:rgba(0,200,230,.22);
  --mt41-hero3:rgba(255,47,147,.18);
  --mt41-hero-end:#fff1fb;
  --mt41-dark-section:#2b0d4b;
  --mt41-dark-section2:#0b6077;
  --mt41-footer:#160824;
}

html[data-theme="corporate"]{
  --mt41-bg:#f7fafc;
  --mt41-surface:rgba(255,255,255,.90);
  --mt41-surface-solid:#ffffff;
  --mt41-text:#0d2340;
  --mt41-muted:#657387;
  --mt41-border:rgba(17,54,91,.12);
  --mt41-primary:#0b4b8b;
  --mt41-secondary:#1669c5;
  --mt41-accent:#2a8bc7;
  --mt41-accent2:#51a9a3;
  --mt41-accent3:#4b72a9;
  --mt41-dark:#0b2340;
  --mt41-grid:rgba(11,75,139,.025);
  --mt41-hero1:rgba(25,101,182,.15);
  --mt41-hero2:rgba(42,139,199,.13);
  --mt41-hero3:rgba(81,169,163,.07);
  --mt41-hero-end:#edf5fb;
  --mt41-dark-section:#0a2544;
  --mt41-dark-section2:#16496b;
  --mt41-footer:#071a2d;
}

*{box-sizing:border-box}
html{background:var(--mt41-bg);transition:background .35s ease,color .35s ease}
body{
  color:var(--mt41-text)!important;
  background:
    radial-gradient(circle at 10% -5%,var(--mt41-hero1),transparent 28rem),
    radial-gradient(circle at 94% 1%,var(--mt41-hero2),transparent 31rem),
    radial-gradient(circle at 55% 90%,var(--mt41-hero3),transparent 34rem),
    var(--mt41-bg)!important;
  transition:background .35s ease,color .35s ease;
}
body:before{
  background-image:
    linear-gradient(var(--mt41-grid) 1px,transparent 1px),
    linear-gradient(90deg,var(--mt41-grid) 1px,transparent 1px)!important;
}

/* Theme switcher */
.mt41-theme-switcher{
  display:flex;
  gap:6px;
  align-items:center;
  padding:5px;
  border-radius:16px;
  background:var(--mt41-surface);
  border:1px solid var(--mt41-border);
  box-shadow:0 14px 34px rgba(28,37,98,.09);
  backdrop-filter:blur(18px);
}
.mt41-theme-switcher button{
  width:34px;height:34px;border-radius:10px!important;
  border:1px solid transparent!important;
  background:transparent!important;
  color:var(--mt41-text)!important;
  padding:0!important;
  display:grid;place-items:center;
  cursor:pointer;
  box-shadow:none!important;
  transform:none!important;
  font-size:13px!important;
}
.mt41-theme-switcher button[aria-pressed="true"]{
  background:linear-gradient(135deg,var(--mt41-primary),var(--mt41-accent))!important;
  color:#fff!important;
  box-shadow:0 10px 24px rgba(80,84,205,.22)!important;
}
.mt41-theme-label{
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
  color:var(--mt41-muted);
  margin-right:4px;
  text-transform:uppercase;
}

/* Header / navigation */
.header,.v36-head{
  background:color-mix(in srgb,var(--mt41-surface-solid) 76%, transparent)!important;
  border-bottom:1px solid var(--mt41-border)!important;
  box-shadow:0 14px 48px rgba(22,30,80,.07)!important;
}
.brand,.brand strong,.v36-brand,.nav a,.v36-links a{color:var(--mt41-text)!important}
.topbar,.v36-top{
  background:linear-gradient(90deg,var(--mt41-dark),color-mix(in srgb,var(--mt41-dark) 70%,var(--mt41-secondary)))!important;
}
.announcement,.v37-band{
  background:linear-gradient(105deg,var(--mt41-primary),var(--mt41-secondary),var(--mt41-accent))!important;
}

/* Hero */
.hero,.v36-hero{
  color:var(--mt41-text)!important;
  background:
    radial-gradient(circle at 12% 8%,var(--mt41-hero1),transparent 28rem),
    radial-gradient(circle at 90% 6%,var(--mt41-hero2),transparent 31rem),
    radial-gradient(circle at 68% 82%,var(--mt41-hero3),transparent 25rem),
    linear-gradient(180deg,var(--mt41-surface-solid),var(--mt41-bg) 65%,var(--mt41-hero-end))!important;
}
.hero h1,.v36-hero h1,.section-head h2,.v36-section h2,.card h3,.v36-card h3{
  color:var(--mt41-text)!important;
}
.hero p,.v36-hero p,.lead,.section-head p,.v36-section p,.card p,.v36-card p{
  color:var(--mt41-muted)!important;
}
.gradient{
  background:linear-gradient(90deg,var(--mt41-primary),var(--mt41-secondary),var(--mt41-accent),var(--mt41-accent2))!important;
  -webkit-background-clip:text!important;
  background-clip:text!important;
  color:transparent!important;
}

/* Surfaces */
.finder,.v36-form,.card,.v36-card,.subject,.learning-card,.material,.compliance-card,.v37-guide,
.v37-calc-panel,.v37-result,.v36-mini-portal,.global-card,.transaction-panel,.application-form,.panel,
.pricing-card,.support-card,.course-card,.mt40-compact{
  background:var(--mt41-surface)!important;
  border:1px solid var(--mt41-border)!important;
  box-shadow:var(--mt41-shadow)!important;
  color:var(--mt41-text)!important;
}
.mt40-compact{
  border-radius:18px!important;
  padding:15px!important;
  margin-top:14px!important;
}
.mt40-head h3,.mt40-field span{color:var(--mt41-text)!important}
.mt40-head p,.mt40-note,.mt40-consent{color:var(--mt41-muted)!important}

/* Forms */
input,select,textarea{
  background:color-mix(in srgb,var(--mt41-surface-solid) 93%, transparent)!important;
  color:var(--mt41-text)!important;
  border-color:var(--mt41-border)!important;
}
input::placeholder,textarea::placeholder{color:color-mix(in srgb,var(--mt41-muted) 75%, transparent)!important}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:rgba(255,255,255,.06)!important;
}
html[data-theme="dark"] select option{background:#101733;color:#fff}

/* Buttons */
.btn-primary,.v36-primary,.finder-submit,.v36-submit,.nav-find,.v36-cta,button[type="submit"]{
  background:linear-gradient(110deg,var(--mt41-primary),var(--mt41-secondary),var(--mt41-accent))!important;
}
.btn-outline,.v36-outline{
  background:var(--mt41-surface)!important;
  border-color:var(--mt41-border)!important;
  color:var(--mt41-text)!important;
}

/* Dark / featured sections */
.schools,.board-section,.v36-dark,.support-result,.school-result,.home-feature,.board-display,.pocket-art,.v36-side,.v37-calc-result{
  background:
    radial-gradient(circle at 82% 8%,color-mix(in srgb,var(--mt41-accent) 25%, transparent),transparent 25rem),
    radial-gradient(circle at 8% 95%,color-mix(in srgb,var(--mt41-primary) 25%, transparent),transparent 28rem),
    linear-gradient(145deg,var(--mt41-dark-section),var(--mt41-dark-section2))!important;
}
.schools *,.board-section *,.v36-dark *,.support-result *,.school-result *,.home-feature *,.board-display *,.pocket-art *,.v36-side *,.v37-calc-result *{
  color:#fff!important;
}
.footer,.v36-footer{background:var(--mt41-footer)!important}

/* Colorful mode extra spectacle */
html[data-theme="colorful"] .card:nth-child(4n+1),
html[data-theme="colorful"] .v36-card:nth-child(4n+1){
  background:linear-gradient(145deg,#fff,#f7efff)!important;
}
html[data-theme="colorful"] .card:nth-child(4n+2),
html[data-theme="colorful"] .v36-card:nth-child(4n+2){
  background:linear-gradient(145deg,#fff,#eefdff)!important;
}
html[data-theme="colorful"] .card:nth-child(4n+3),
html[data-theme="colorful"] .v36-card:nth-child(4n+3){
  background:linear-gradient(145deg,#fff,#fff3f8)!important;
}
html[data-theme="colorful"] .card:nth-child(4n),
html[data-theme="colorful"] .v36-card:nth-child(4n){
  background:linear-gradient(145deg,#fff,#effff8)!important;
}

/* Corporate mode: reduce whimsy, sharper geometry */
html[data-theme="corporate"] .card,
html[data-theme="corporate"] .v36-card,
html[data-theme="corporate"] .finder,
html[data-theme="corporate"] .v36-form{
  border-radius:14px!important;
}
html[data-theme="corporate"] .hero:before,
html[data-theme="corporate"] .v36-hero:before{
  opacity:.45!important;
  filter:blur(25px)!important;
}

/* Dark mode support for legacy text */
html[data-theme="dark"] .section,
html[data-theme="dark"] .v36-section,
html[data-theme="dark"] .section-head,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .section-head p{
  color:var(--mt41-text)!important;
}
html[data-theme="dark"] .footer,
html[data-theme="dark"] .v36-footer{color:#fff!important}

/* Dynamic background layer */
.mt41-motion-layer{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  overflow:hidden;
}
.mt41-blob{
  position:absolute;
  border-radius:50%;
  filter:blur(45px);
  opacity:.24;
  will-change:transform;
}
.mt41-blob.b1{
  width:36rem;height:36rem;left:-12rem;top:10%;
  background:var(--mt41-primary);
  animation:mt41Float1 18s ease-in-out infinite;
}
.mt41-blob.b2{
  width:28rem;height:28rem;right:-8rem;top:33%;
  background:var(--mt41-accent);
  animation:mt41Float2 22s ease-in-out infinite;
}
.mt41-blob.b3{
  width:24rem;height:24rem;left:42%;bottom:-9rem;
  background:var(--mt41-accent3);
  animation:mt41Float3 24s ease-in-out infinite;
}
.mt41-particles{
  position:absolute;inset:0;
  background-image:
    radial-gradient(circle at 20% 25%,color-mix(in srgb,var(--mt41-accent) 30%, transparent) 1px,transparent 1.5px),
    radial-gradient(circle at 70% 65%,color-mix(in srgb,var(--mt41-primary) 30%, transparent) 1px,transparent 1.5px);
  background-size:76px 76px,110px 110px;
  opacity:.35;
  animation:mt41Particle 25s linear infinite;
}
@keyframes mt41Float1{50%{transform:translate(32vw,-6vh) scale(1.05)}}
@keyframes mt41Float2{50%{transform:translate(-28vw,11vh) scale(.94)}}
@keyframes mt41Float3{50%{transform:translate(12vw,-14vh) scale(1.08)}}
@keyframes mt41Particle{to{background-position:76px 76px,-110px 110px}}

/* Hero portal visual enhancer */
.mt41-portal-showcase{
  position:relative;
  margin-top:26px;
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:16px;
  align-items:stretch;
}
.mt41-portal-panel{
  min-height:270px;
  border-radius:24px;
  padding:22px;
  background:linear-gradient(145deg,var(--mt41-dark-section),var(--mt41-dark-section2));
  color:#fff;
  box-shadow:var(--mt41-shadow-xl);
  overflow:hidden;
  position:relative;
}
.mt41-portal-panel:after{
  content:"";
  position:absolute;
  width:230px;height:230px;border-radius:50%;
  right:-80px;top:-90px;
  background:conic-gradient(var(--mt41-primary),var(--mt41-accent),var(--mt41-accent2),var(--mt41-accent3),var(--mt41-primary));
  filter:blur(8px);
  opacity:.48;
}
.mt41-portal-metrics{
  position:relative;z-index:2;
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:34px;
}
.mt41-metric{
  padding:14px;border-radius:13px;
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.10);
}
.mt41-metric b{display:block;font-size:25px}.mt41-metric span{font-size:8px;color:#cfd7eb}
.mt41-phone{
  border-radius:28px;
  min-height:270px;
  padding:22px 16px;
  background:var(--mt41-surface-solid);
  border:1px solid var(--mt41-border);
  box-shadow:var(--mt41-shadow);
  color:var(--mt41-text);
  position:relative;
}
.mt41-phone:before{
  content:"";display:block;width:46px;height:5px;border-radius:99px;
  background:var(--mt41-border);margin:0 auto 18px;
}
.mt41-phone-card{
  padding:12px;border-radius:13px;margin-top:9px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--mt41-primary) 10%,var(--mt41-surface-solid)),color-mix(in srgb,var(--mt41-accent) 8%,var(--mt41-surface-solid)));
  border:1px solid var(--mt41-border);
}
.mt41-phone-card b{display:block;font-size:11px}.mt41-phone-card span{display:block;margin-top:4px;font-size:8px;color:var(--mt41-muted)}

@media(max-width:900px){
  .mt41-theme-label{display:none}
  .mt41-portal-showcase{grid-template-columns:1fr}
}
@media(max-width:680px){
  .mt41-theme-switcher{gap:4px}
  .mt41-theme-switcher button{width:31px;height:31px}
}
@media(prefers-reduced-motion:reduce){
  .mt41-blob,.mt41-particles{animation:none!important}
}
