/* ============================================
   SWA Glass + Metallic UI
   Green metal sheen · frosted glass · no lag loops
   ============================================ */

:root {
  --gm-glass: linear-gradient(155deg, rgba(255, 255, 255, 0.78), rgba(245, 250, 247, 0.55));
  --gm-glass-strong: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(240, 248, 243, 0.7));
  --gm-edge: rgba(255, 255, 255, 0.7);
  --gm-line: rgba(34, 130, 58, 0.18);
  --gm-metal: #0f3d1c;
  --gm-metal-silver: linear-gradient(
    145deg,
    #ffffff 0%,
    #eef3f0 22%,
    #c5d4cb 48%,
    #8fa396 70%,
    #dfe8e2 100%
  );
  --gm-inset: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -1px 0 rgba(12, 40, 24, 0.08);
}

/* ---- Glass cards ---- */
.glass-card,
body.swa-desk .inner-card,
body.swa-desk .tool-card,
body.swa-desk .feature-block,
body.swa-desk .pricing-card,
body.swa-desk .blog-card,
body.dash-body .dash-card,
body.dash-body .study-card,
body.dash-body .spath-card {
  position: relative;
  background: var(--gm-glass);
  border: 1px solid var(--gm-line);
  box-shadow:
    var(--gm-inset),
    0 18px 40px rgba(12, 40, 24, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  overflow: hidden;
}

.glass-card::before,
body.swa-desk .inner-card::before,
body.swa-desk .tool-card::before,
body.dash-body .dash-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
  pointer-events: none;
  z-index: 0;
}

.glass-card > *,
body.swa-desk .inner-card > *,
body.swa-desk .tool-card > *,
body.dash-body .dash-card > * {
  position: relative;
  z-index: 1;
}

/* Soft glass (optional blur — single layer, not stacked) */
.glass-frost {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--gm-inset), 0 16px 40px rgba(12, 40, 24, 0.1);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-frost {
    background: rgba(255, 255, 255, 0.92);
  }
}

/* ---- Metallic border frame ---- */
.metal-frame {
  position: relative;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(157, 206, 168, 0.7) 35%,
    rgba(34, 130, 58, 0.55) 65%,
    rgba(255, 255, 255, 0.85)
  );
  box-shadow: 0 24px 60px rgba(12, 40, 24, 0.14);
}

.metal-frame > .metal-inner {
  border-radius: inherit;
  background: var(--gm-glass-strong);
  height: 100%;
  overflow: hidden;
}

/* ---- Metallic CTA (green metal, shine on hover only) ---- */
.btn-metal,
body.auth-desk .auth-cta,
body.auth-desk .theme-btn.btn-one,
body.auth-desk .theme-btn.btn-one.btn-block,
body.auth-desk .auth-top .theme-btn.btn-one,
body.swa-desk .theme-btn.btn-one.metal {
  position: relative;
  overflow: hidden;
  color: #fff !important;
  border: 1px solid #0a2a14 !important;
  background: #0f3d1c !important;
  background-image: none !important;
  box-shadow:
    0 10px 24px rgba(8, 40, 20, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.28) !important;
  text-shadow: none;
}

.btn-metal::after,
body.auth-desk .auth-cta::after,
body.auth-desk .theme-btn.btn-one.btn-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
  animation: none !important;
}

.btn-metal:hover::after,
body.auth-desk .auth-cta:hover::after,
body.auth-desk .theme-btn.btn-one.btn-block:hover::after {
  transform: translateX(120%);
}

.btn-metal:hover,
body.auth-desk .auth-cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Silver glass button (Google / secondary) */
.btn-glass,
body.auth-desk .btn-google {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(240, 247, 243, 0.85)) !important;
  border: 1px solid rgba(34, 130, 58, 0.16) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 22px rgba(12, 40, 24, 0.06) !important;
}

body.auth-desk .btn-google:hover {
  border-color: rgba(34, 130, 58, 0.35) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    0 12px 28px rgba(34, 130, 58, 0.12) !important;
}

/* ---- Auth: glassy chrome + metal shell ---- */
body.auth-desk .auth-top {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 28px rgba(12, 40, 24, 0.08);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

body.auth-desk .auth-shell {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(157, 206, 168, 0.75) 30%,
    rgba(34, 130, 58, 0.5) 60%,
    rgba(255, 255, 255, 0.9)
  );
  border: none;
  box-shadow: 0 28px 70px rgba(8, 30, 18, 0.16);
  padding: 1.5px;
  overflow: hidden;
}

body.auth-desk .auth-panel {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(244, 250, 246, 0.88)),
    #fafdfb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body.auth-desk .auth-section,
body.auth-desk .password-rules {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.75), rgba(238, 247, 241, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 24px rgba(12, 40, 24, 0.05);
}

body.auth-desk .auth-field .form-control,
body.auth-desk .form-control {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 247, 241, 0.75));
  border: 1px solid rgba(34, 130, 58, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.auth-desk .form-control:focus {
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 0 0 3px rgba(34, 130, 58, 0.14),
    inset 0 1px 0 #fff;
}

body.auth-desk .auth-visual {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.auth-desk .auth-stat,
body.auth-desk .auth-tick,
body.auth-desk .auth-float-chip,
body.auth-desk .brand-pill {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.auth-desk .auth-field i.field-ico {
  background: linear-gradient(145deg, #e8f5ec, #c8e6d0);
  border: 1px solid rgba(34, 130, 58, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.auth-desk .auth-field:focus-within i.field-ico {
  background: var(--gm-metal);
  color: #fff;
  border-color: transparent;
}

/* ---- Nav glass refresh ---- */
body.swa-desk .main-header.nav-v2 .nav-v2-bar,
body.swa-desk .main-header.nav-v2 .header-lower {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 -1px 0 rgba(34, 130, 58, 0.06),
    0 10px 30px rgba(12, 40, 24, 0.06);
}

body.swa-desk .nav-v2 .nav-actions .btn-one {
  background: #0f3d1c !important;
  background-image: none !important;
  border: 1px solid #0a2a14;
  box-shadow: 0 8px 18px rgba(8, 40, 20, 0.3);
}

body.swa-desk .nav-v2 .nav-actions .btn-two {
  background: linear-gradient(180deg, #fff, #f3f8f5);
  border: 1px solid rgba(34, 130, 58, 0.18);
  box-shadow: inset 0 1px 0 #fff;
}

/* ---- Desk / school metallic accents ---- */
body.swa-desk .theme-btn.btn-one {
  box-shadow:
    0 10px 24px rgba(34, 130, 58, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.swa-desk .school-grade-card,
body.swa-desk .lesson-card {
  background: var(--gm-glass);
  border: 1px solid var(--gm-line);
  box-shadow: var(--gm-inset), 0 16px 36px rgba(12, 40, 24, 0.08);
}

/* Allow glass blur on intentional surfaces (perf.css overrides were too broad) */
body.auth-desk .auth-top,
body.auth-desk .glass-frost,
body.swa-desk .main-header.nav-v2 .nav-v2-bar {
  backdrop-filter: blur(12px) saturate(1.1) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.1) !important;
}

@media (max-width: 700px) {
  body.auth-desk .auth-top,
  body.auth-desk .glass-frost,
  body.swa-desk .main-header.nav-v2 .nav-v2-bar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.94) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-metal::after,
  body.auth-desk .auth-cta::after {
    transition: none !important;
  }
}
