/* ============================================
   SWA — Extra-good UI layer (v4 fun polish)
   School · Dashboard · Public surfaces
   ============================================ */

:root {
  --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ui-lift: 0 20px 48px rgba(15, 40, 25, 0.12);
}

/* ---- Ambient page mesh ---- */
body.swa-desk {
  background:
    radial-gradient(ellipse 80% 50% at 0% -10%, rgba(34, 130, 58, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(125, 206, 160, 0.1), transparent 50%),
    #ffffff;
}

body.dash-body.study-desk {
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(34, 130, 58, 0.08), transparent 50%),
    #ffffff !important;
}

/* ---- Button shine ---- */
body.swa-desk .theme-btn.btn-one,
body.dash-body .theme-btn.btn-one,
body.auth-desk .theme-btn.btn-one {
  position: relative;
  overflow: hidden;
}

body.swa-desk .theme-btn.btn-one::after,
body.dash-body .theme-btn.btn-one::after,
body.auth-desk .theme-btn.btn-one::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.45s var(--ui-ease);
  pointer-events: none;
}

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

/* ---- School hero richer ---- */
.school-hero {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.school-hero .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.school-hero .hero-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7dcea0;
  box-shadow: 0 0 0 4px rgba(125, 206, 160, 0.25);
  animation: none;
  box-shadow: 0 0 0 3px rgba(34, 130, 58, 0.18);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}

.school-progress-bar {
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.school-progress-track {
  height: 12px !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

.school-progress-fill {
  background: linear-gradient(90deg, #fff, #b8f0c8, #fff) !important;
  background-size: 200% 100% !important;
  animation: none;
}

@keyframes progressShine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---- Grade cards entrance ---- */
.school-grade-card {
  animation: cardIn 0.55s var(--ui-ease) both;
  border: 1px solid rgba(34, 130, 58, 0.14) !important;
}

.school-grade-card:nth-child(1) { animation-delay: 0.02s; }
.school-grade-card:nth-child(2) { animation-delay: 0.05s; }
.school-grade-card:nth-child(3) { animation-delay: 0.08s; }
.school-grade-card:nth-child(4) { animation-delay: 0.11s; }
.school-grade-card:nth-child(5) { animation-delay: 0.14s; }
.school-grade-card:nth-child(6) { animation-delay: 0.17s; }
.school-grade-card:nth-child(7) { animation-delay: 0.2s; }
.school-grade-card:nth-child(8) { animation-delay: 0.23s; }
.school-grade-card:nth-child(9) { animation-delay: 0.26s; }
.school-grade-card:nth-child(10) { animation-delay: 0.29s; }
.school-grade-card:nth-child(11) { animation-delay: 0.32s; }
.school-grade-card:nth-child(12) { animation-delay: 0.35s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.school-grade-card h3 {
  font-family: var(--font-head, Syne, sans-serif);
  letter-spacing: -0.02em;
}

.school-grade-num {
  position: absolute !important;
  top: 1rem;
  right: 1rem;
  box-shadow: 0 8px 18px rgba(34, 130, 58, 0.28);
}

.school-grade-meta .grade-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(34, 130, 58, 0.1);
  color: #145524 !important;
  font-weight: 800;
  font-size: 0.78rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.school-grade-meta .grade-cta:hover {
  background: #22823a;
  color: #fff !important;
  transform: translateX(3px);
}

.school-lesson-list {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin: 0.35rem 0;
  border-top: 1px dashed rgba(34, 130, 58, 0.15);
  border-bottom: 1px dashed rgba(34, 130, 58, 0.15);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.school-lesson-list a {
  border-radius: 8px;
  padding: 0.4rem 0.5rem !important;
  transition: background 0.15s;
}

.school-lesson-list a:hover {
  background: rgba(34, 130, 58, 0.07);
}

.quiz-badge {
  display: inline-flex;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-badge.pass {
  background: rgba(34, 130, 58, 0.15);
  color: #145524;
}

.quiz-badge.ready {
  background: rgba(46, 168, 85, 0.18);
  color: #0f5c28;
  animation: none;
  box-shadow: 0 0 0 3px rgba(34, 130, 58, 0.18);
}

/* ---- Lesson reader ---- */
.school-layout {
  gap: 1.5rem !important;
}

.school-sidebar {
  background: #fff !important;
  border: 1px solid rgba(34, 130, 58, 0.12) !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 36px rgba(15, 40, 25, 0.06);
  padding: 1.15rem !important;
}

.school-sidebar .grade-block {
  padding: 0.55rem;
  border-radius: 12px;
  transition: background 0.2s;
}

.school-sidebar .grade-block:hover {
  background: rgba(34, 130, 58, 0.04);
}

.school-sidebar nav a {
  border-radius: 10px !important;
  margin-bottom: 2px;
}

.school-sidebar nav a.active {
  background: linear-gradient(135deg, rgba(34, 130, 58, 0.16), rgba(34, 130, 58, 0.06)) !important;
  box-shadow: inset 3px 0 0 #22823a;
}

.school-main {
  padding: clamp(1.35rem, 3vw, 2.25rem) !important;
  border-radius: 20px !important;
  border: 1px solid rgba(34, 130, 58, 0.12) !important;
  box-shadow: var(--ui-lift) !important;
}

.school-main h1 {
  font-family: var(--font-head, Syne, sans-serif);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0.35rem 0 0.65rem;
  max-width: 22ch;
}

.school-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 130, 58, 0.08);
  color: #145524 !important;
  font-weight: 700;
  font-size: 0.8rem !important;
  margin-bottom: 1.25rem !important;
}

.school-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #2a332f;
}

.school-content h3 {
  font-family: var(--font-head, Syne, sans-serif);
  margin-top: 1.5rem;
  letter-spacing: -0.02em;
}

.school-content ul li,
.school-content ol li {
  margin: 0.35rem 0;
}

.lesson-callout {
  position: relative;
  padding-left: 1.25rem !important;
  box-shadow: 0 10px 28px rgba(15, 40, 25, 0.05);
}

.lesson-callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 4px;
  border-radius: 999px;
  background: #22823a;
}

.lesson-callout.warn::before {
  background: #c87828;
}

.school-complete-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding: 1.15rem 1.25rem !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, rgba(34, 130, 58, 0.1), rgba(255, 255, 255, 0.95)) !important;
  border: 1px solid rgba(34, 130, 58, 0.2) !important;
}

.school-nav-footer {
  margin-top: 1.25rem;
  gap: 0.75rem !important;
}

.school-nav-footer a {
  padding: 0.75rem 1.1rem !important;
  border-radius: 12px !important;
  border: 1px solid rgba(34, 130, 58, 0.18);
  background: #fff;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.school-nav-footer a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 40, 25, 0.08);
}

.school-nav-footer .btn-next,
.school-nav-footer .btn-complete {
  background: linear-gradient(145deg, #2ea855, #1a6b2e) !important;
  color: #fff !important;
  border: none !important;
}

/* ---- Quizzes ---- */
.school-quiz {
  margin-top: 1.5rem;
  padding: 1.5rem !important;
  border-radius: 20px !important;
  background: #fff !important;
  border: 1px solid rgba(34, 130, 58, 0.14) !important;
  box-shadow: var(--ui-lift);
}

.school-quiz-q {
  padding: 1rem;
  border-radius: 14px;
  background: #f7fbf8;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(34, 130, 58, 0.08);
}

.school-quiz-q label {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem !important;
  border-radius: 12px !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.school-quiz-q label:hover {
  background: rgba(34, 130, 58, 0.08) !important;
  border-color: rgba(34, 130, 58, 0.2);
}

.school-quiz-submit {
  background: linear-gradient(145deg, #2ea855, #1a6b2e) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 0.75rem 1.35rem !important;
  font-weight: 800 !important;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(34, 130, 58, 0.28);
}

/* ---- Study dashboard ---- */
.study-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px !important;
  padding: 1.75rem 1.85rem !important;
}

.study-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.study-tracker-bar {
  border-radius: 18px !important;
  background: linear-gradient(180deg, #fff, #f7fbf8) !important;
}

.st-stat {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(34, 130, 58, 0.05);
}

.spath-body {
  transition: transform 0.25s var(--ui-ease), box-shadow 0.25s;
}

.spath-body:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 40, 25, 0.08);
}

.types-grid a {
  background: linear-gradient(165deg, #fff, #f6faf7) !important;
  border-radius: 16px !important;
}

.tr-grade {
  transition: transform 0.2s, box-shadow 0.2s;
}

.tr-grade:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 40, 25, 0.08);
}

/* ---- Public inner cards ---- */
body.swa-desk .inner-card,
body.swa-desk .tool-card {
  border-radius: 18px;
  border: 1px solid rgba(34, 130, 58, 0.12);
  box-shadow: 0 10px 32px rgba(15, 40, 25, 0.06);
  transition: transform 0.25s var(--ui-ease), box-shadow 0.25s;
}

body.swa-desk .inner-card:hover,
body.swa-desk .tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ui-lift);
}

body.swa-desk .page-hero-art,
body.swa-desk .img-3d {
  filter: drop-shadow(0 16px 28px rgba(34, 130, 58, 0.22));
  transition: transform 0.35s var(--ui-ease);
}

body.swa-desk .page-hero-art:hover,
body.swa-desk .img-3d.float:hover {
  transform: translateY(-6px) rotate(-3deg) scale(1.04);
}

/* ---- Auth polish ---- */
body.auth-desk .auth-form-panel input {
  padding: 0.85rem 1rem;
}

body.auth-desk .auth-form-panel label {
  font-weight: 700;
  font-size: 0.82rem;
  color: #3d4a42;
}

/* ---- Sec titles ---- */
body.swa-desk .sec-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
}

@media (prefers-reduced-motion: reduce) {
  .school-grade-card,
  .school-progress-fill,
  .hero-eyebrow .dot,
  .quiz-badge.ready {
    animation: none !important;
  }
}
