/* ============================================================================
   EduSave Enterprise Suite — shared login/landing styling
   Used by: /login_selector.php, /login.php, /erp/login.php
   Pure additive CSS — no rule here touches form/field/button IDs that the
   existing authentication JS in login.php or erp/login.php depends on.
   ========================================================================== */

:root {
  --edusave-blue: #0F3D91;
  --edusave-blue-dark: #0a2a68;
  --edusave-gold: #D4AF37;
  --edusave-ink: #0a244f;
  --edusave-mist: #eef2f9;
}

/* ── Animated enterprise background ────────────────────────────────────── */
.edusave-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(120deg, #0a2a68 0%, #0F3D91 45%, #123a7a 75%, #0a244f 100%);
  background-size: 220% 220%;
  animation: edusaveGradient 18s ease-in-out infinite;
}
@keyframes edusaveGradient {
  0%   { background-position: 0% 40%; }
  50%  { background-position: 100% 60%; }
  100% { background-position: 0% 40%; }
}

/* Soft floating geometric shapes — decorative only, aria-hidden in markup */
.edusave-shape {
  position: fixed;
  z-index: -1;
  border-radius: 9999px;
  filter: blur(2px);
  opacity: .18;
  background: radial-gradient(circle at 30% 30%, var(--edusave-gold), transparent 70%);
  animation: edusaveFloat 12s ease-in-out infinite;
}
.edusave-shape.s1 { width: 340px; height: 340px; top: -120px;  left: -100px; animation-delay: 0s; }
.edusave-shape.s2 { width: 260px; height: 260px; bottom: -90px; right: -60px; animation-delay: 2.5s;
  background: radial-gradient(circle at 30% 30%, #ffffff, transparent 70%); opacity: .10; }
.edusave-shape.s3 { width: 180px; height: 180px; top: 30%;     right: 8%;    animation-delay: 5s;
  background: radial-gradient(circle at 30% 30%, var(--edusave-gold), transparent 70%); opacity: .12; }

@keyframes edusaveFloat {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  50%      { transform: translateY(-24px) translateX(14px) scale(1.04); }
}

/* ── Glassmorphism card ─────────────────────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 30px 80px rgba(10, 36, 79, 0.35);
}

/* ── Entrance animations (pure CSS — no JS required) ───────────────────── */
.fade-in       { animation: edusaveFadeIn .7s ease both; }
.slide-up      { animation: edusaveSlideUp .6s cubic-bezier(.21,.9,.32,1) both; }
.slide-up-d1   { animation-delay: .1s; }
.slide-up-d2   { animation-delay: .22s; }
.slide-up-d3   { animation-delay: .34s; }

@keyframes edusaveFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes edusaveSlideUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Workspace selector cards ───────────────────────────────────────────── */
.workspace-card {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 24px;
  padding: 32px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 40px rgba(10, 36, 79, 0.14);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  overflow: hidden;
}
.workspace-card:hover,
.workspace-card:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(10, 36, 79, 0.28);
  border-color: rgba(212, 175, 55, 0.55);
}
.workspace-card:focus-visible {
  outline: 3px solid var(--edusave-gold);
  outline-offset: 3px;
}
.workspace-card .ws-icon {
  transition: transform .35s ease;
}
.workspace-card:hover .ws-icon,
.workspace-card:focus-visible .ws-icon {
  transform: scale(1.12) rotate(-4deg);
}
.workspace-card .ws-shine {
  position: absolute;
  top: -60%;
  left: -60%;
  width: 60%;
  height: 220%;
  background: linear-gradient(120deg, transparent, rgba(212,175,55,.18), transparent);
  transform: rotate(20deg);
  transition: left .6s ease;
  pointer-events: none;
}
.workspace-card:hover .ws-shine,
.workspace-card:focus-visible .ws-shine {
  left: 130%;
}

/* Enter button glow */
.btn-glow {
  transition: transform .2s ease, box-shadow .3s ease, background-position .3s ease;
  background-size: 160% 160%;
}
.btn-glow:hover,
.btn-glow:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.45);
}
.btn-glow:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Generic focus-visible safety net for links/buttons on these pages */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--edusave-gold);
  outline-offset: 2px;
}

/* Logo scaling helper — used on all three pages */
.edusave-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.18));
}
@media (max-width: 640px) {
  .edusave-logo { height: 56px; }
}

/* Back-to-selector link, shared visual treatment */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  opacity: .9;
  text-decoration: none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-link:hover { opacity: 1; transform: translateX(-3px); }
.back-link.on-light { color: var(--edusave-ink); opacity: .75; }
.back-link.on-light:hover { opacity: 1; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .edusave-bg, .edusave-shape, .fade-in, .slide-up,
  .workspace-card, .btn-glow, .ws-icon, .ws-shine {
    animation: none !important;
    transition: none !important;
  }
}


/* ── Disabled workspace card ─────────────────────────────────────────────
   Used by the "Enter EduSave SMS" card while the School Management System is
   not yet part of this package. Purely additive: it neutralises the hover and
   pointer affordances of .workspace-card without changing its layout, colours
   or typography. Remove the ws-disabled class to re-enable the card. */
.workspace-card.ws-disabled {
  /* The .slide-up entrance animation ends on opacity:1 with fill-mode `both`,
     and an animated property beats a normal declaration — so the dimming is
     expressed through filter(), which the animation does not touch. */
  filter: grayscale(.45) opacity(.62);
  cursor: not-allowed;
  box-shadow: 0 10px 24px rgba(10, 36, 79, 0.10);
}
.workspace-card.ws-disabled:hover,
.workspace-card.ws-disabled:focus-visible {
  transform: none;
  box-shadow: 0 10px 24px rgba(10, 36, 79, 0.10);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}
.workspace-card.ws-disabled:hover .ws-icon,
.workspace-card.ws-disabled:focus-visible .ws-icon { transform: none; }
.workspace-card.ws-disabled .ws-shine { display: none; }
.workspace-card.ws-disabled .btn-glow { pointer-events: none; }
.workspace-card.ws-disabled .btn-glow:hover,
.workspace-card.ws-disabled .btn-glow:focus-visible { transform: none; box-shadow: none; }

.ws-unavailable {
  display: block;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}
