/* ============================================
   SWA Market — App-wide UI Upgrade (v3)
   White + dark green · Syne / DM Sans
   Loads last on all surfaces
   ============================================ */

:root {
  --swa-radius: 16px;
  --swa-radius-sm: 11px;
  --swa-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --swa-glow: 0 16px 40px rgba(34, 130, 58, 0.16);
}

/* ---- Global polish ---- */
body.swa-desk,
body.dash-body,
body.auth-desk {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(34, 130, 58, 0.22);
  color: #0f1412;
}

/* Smooth focus for interactive controls */
body.swa-desk :focus-visible,
body.dash-body :focus-visible,
body.auth-desk :focus-visible {
  outline: 2px solid #22823a;
  outline-offset: 3px;
}

/* ---- Buttons ---- */
body.swa-desk .theme-btn,
body.dash-body .theme-btn,
body.auth-desk .theme-btn {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--swa-ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

body.swa-desk .theme-btn.btn-one,
body.dash-body .theme-btn.btn-one,
body.auth-desk .theme-btn.btn-one {
  background: #145524;
  border: none;
  color: #fff;
  box-shadow: 0 10px 24px rgba(8, 40, 20, 0.3);
}

body.auth-desk .theme-btn.btn-one,
body.auth-desk .theme-btn.btn-one.btn-block,
body.auth-desk .auth-cta,
body.auth-desk button.theme-btn.btn-one {
  background: #0f3d1c !important;
  background-image: none !important;
  border: 1px solid #0a2a14 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(8, 40, 20, 0.35) !important;
}

body.auth-desk .theme-btn.btn-one:hover,
body.auth-desk .auth-cta:hover {
  background: #145524 !important;
  background-image: none !important;
  filter: none;
}

body.swa-desk .theme-btn.btn-one:hover,
body.dash-body .theme-btn.btn-one:hover,
body.auth-desk .theme-btn.btn-one:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(34, 130, 58, 0.36);
}

body.swa-desk .theme-btn.btn-two,
body.dash-body .theme-btn.btn-two,
body.auth-desk .theme-btn.btn-two {
  background: #fff;
  border: 1px solid rgba(34, 130, 58, 0.28);
  color: #145524;
}

body.swa-desk .theme-btn.btn-two:hover,
body.dash-body .theme-btn.btn-two:hover,
body.auth-desk .theme-btn.btn-two:hover {
  background: rgba(34, 130, 58, 0.08);
  border-color: #22823a;
  transform: translateY(-1px);
}

body.swa-desk .theme-btn:active,
body.dash-body .theme-btn:active,
body.auth-desk .theme-btn:active,
body.swa-desk .theme-btn.btn-one:active,
body.dash-body .theme-btn.btn-one:active,
body.auth-desk .theme-btn.btn-one:active,
body.swa-desk .theme-btn.btn-two:active,
body.dash-body .theme-btn.btn-two:active,
body.auth-desk .theme-btn.btn-two:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 14px rgba(8, 40, 20, 0.22);
}

/* ---- Shared form tokens ---- */
body.swa-desk .desk-form label,
body.dash-body .dash-form label {
  display: block;
  font-family: var(--font-head, Syne, sans-serif);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
  color: #1a2a22;
}

body.swa-desk .desk-form input,
body.swa-desk .desk-form textarea,
body.swa-desk .desk-form select,
body.dash-body .dash-form input,
body.dash-body .dash-form textarea,
body.dash-body .dash-form select {
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 1px solid rgba(34, 130, 58, 0.18);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  color: #0f1412;
  margin-bottom: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

body.swa-desk .desk-form input:hover,
body.swa-desk .desk-form textarea:hover,
body.dash-body .dash-form input:hover,
body.dash-body .dash-form textarea:hover {
  border-color: rgba(34, 130, 58, 0.32);
}

body.swa-desk .desk-form input:focus,
body.swa-desk .desk-form textarea:focus,
body.swa-desk .desk-form select:focus,
body.dash-body .dash-form input:focus,
body.dash-body .dash-form textarea:focus,
body.dash-body .dash-form select:focus {
  outline: none;
  border-color: #22823a;
  box-shadow: 0 0 0 3px rgba(34, 130, 58, 0.14);
  background: #fff;
}

/* ---- Empty states ---- */
body.dash-body .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  max-width: 22rem;
  margin: 1rem auto;
  padding: 1.5rem 1.25rem;
  border: 1px dashed rgba(34, 130, 58, 0.28);
  border-radius: 16px;
  background: rgba(232, 245, 236, 0.45);
  animation: emptyFade 0.35s var(--swa-ease);
}

body.dash-body .empty-state > i {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f5ec;
  color: #145524;
  opacity: 1;
  font-size: 1.1rem;
}

body.dash-body .empty-state p {
  margin: 0;
  color: #4a5b52;
  font-size: 0.92rem;
  line-height: 1.45;
}

@keyframes emptyFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.swa-desk .theme-btn,
  body.dash-body .theme-btn,
  body.auth-desk .theme-btn,
  body.dash-body .empty-state {
    transition: none !important;
    animation: none !important;
  }
  body.swa-desk .theme-btn:hover,
  body.dash-body .theme-btn:hover,
  body.auth-desk .theme-btn:hover,
  body.swa-desk .theme-btn:active,
  body.dash-body .theme-btn:active,
  body.auth-desk .theme-btn:active {
    transform: none !important;
  }
}

/* ---- Page heroes / banners ---- */
body.swa-desk .page-title,
body.swa-desk .inner-banner,
body.swa-desk .page-banner {
  background:
    radial-gradient(ellipse 70% 80% at 90% 10%, rgba(125, 206, 160, 0.28), transparent 50%),
    linear-gradient(135deg, #0f1a14 0%, #163022 48%, #1a6b2e 100%) !important;
  border-bottom: none;
}

body.swa-desk .page-title h1,
body.swa-desk .inner-banner h1,
body.swa-desk .page-banner h1 {
  font-family: var(--font-head, Syne, sans-serif);
  letter-spacing: -0.02em;
}

/* ---- Cards & panels (public) ---- */
body.swa-desk .feature-block,
body.swa-desk .service-block,
body.swa-desk .news-block,
body.swa-desk .pricing-block,
body.swa-desk .account-block,
body.swa-desk .market-card,
body.swa-desk .live-card,
body.swa-desk .blog-card,
body.swa-desk .faq-item,
body.swa-desk .content-card {
  border-radius: var(--swa-radius);
  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(--swa-ease), box-shadow 0.25s, border-color 0.2s;
}

body.swa-desk .feature-block:hover,
body.swa-desk .service-block:hover,
body.swa-desk .news-block:hover,
body.swa-desk .pricing-block:hover,
body.swa-desk .account-block:hover,
body.swa-desk .market-card:hover,
body.swa-desk .live-card:hover,
body.swa-desk .blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 130, 58, 0.28);
  box-shadow: 0 18px 44px rgba(15, 40, 25, 0.1);
}

/* ---- Sections ---- */
body.swa-desk .sec-title {
  font-family: var(--font-head, Syne, sans-serif);
  letter-spacing: -0.02em;
}

body.swa-desk .sec-title .title {
  color: #22823a;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

body.swa-desk section {
  scroll-margin-top: 90px;
}

/* Soft section backgrounds alternate */
body.swa-desk .about-section,
body.swa-desk .faq-section,
body.swa-desk .news-section,
body.swa-desk .cta-section {
  position: relative;
}

/* ---- Forms ---- */
body.swa-desk input,
body.swa-desk textarea,
body.swa-desk select,
body.auth-desk input,
body.auth-desk textarea,
body.auth-desk select,
body.dash-body .dash-form input,
body.dash-body .dash-form textarea,
body.dash-body .dash-form select {
  border-radius: var(--swa-radius-sm);
  border: 1px solid rgba(34, 130, 58, 0.22);
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.swa-desk input:focus,
body.swa-desk textarea:focus,
body.swa-desk select:focus,
body.auth-desk input:focus,
body.auth-desk textarea:focus,
body.auth-desk select:focus,
body.dash-body .dash-form input:focus,
body.dash-body .dash-form textarea:focus,
body.dash-body .dash-form select:focus {
  border-color: #22823a;
  box-shadow: 0 0 0 4px rgba(34, 130, 58, 0.12);
  outline: none;
}

/* ---- Footer ---- */
body.swa-desk .main-footer,
body.swa-desk footer.site-footer {
  background: linear-gradient(180deg, #0f1412 0%, #0a100c 100%);
  border-top: 1px solid rgba(34, 130, 58, 0.2);
}

body.swa-desk .main-footer a:hover,
body.swa-desk footer.site-footer a:hover {
  color: #7dcea0;
}

/* ---- Live boards ---- */
body.swa-desk .live-board,
body.swa-desk .fx-tile,
body.swa-desk .watch-tile,
body.swa-desk .crypto-row {
  border-radius: 14px;
  border: 1px solid rgba(34, 130, 58, 0.14);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 40, 25, 0.05);
}

body.swa-desk .live-strip,
body.swa-desk .ticker-strip {
  border-bottom: 1px solid rgba(34, 130, 58, 0.12);
}

/* ---- School pages ---- */
body.swa-desk[data-page="school"] .school-hero,
body.swa-desk[data-page="lesson"] .school-hero,
.school-hero {
  border-radius: 0 0 28px 28px;
}

.school-grade-card {
  border-radius: 18px !important;
}

.school-grade-card .grade-num,
.school-grade-card .num {
  background: rgba(34, 130, 58, 0.1);
  color: #145524;
  border-radius: 12px;
}

.lesson-body,
.school-main,
.lesson-panel {
  border-radius: 18px;
  border: 1px solid rgba(34, 130, 58, 0.12);
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 40, 25, 0.06);
}

.lesson-body h2,
.lesson-body h3,
.school-main h2 {
  font-family: var(--font-head, Syne, sans-serif);
  color: #131615;
}

.lesson-nav a,
.school-sidebar a {
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}

.lesson-nav a:hover,
.school-sidebar a:hover,
.school-sidebar a.active {
  background: rgba(34, 130, 58, 0.1);
  color: #145524;
}

.lesson-complete-btn,
#mark-complete,
button.mark-complete {
  border-radius: 12px !important;
}

/* ---- Auth pages ---- */
body.auth-desk .auth-shell {
  border-radius: 22px;
  border: 1px solid rgba(34, 130, 58, 0.14);
  box-shadow: 0 24px 60px rgba(15, 40, 25, 0.12);
}

body.auth-desk .auth-form-panel {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

body.auth-desk .auth-form-panel h1,
body.auth-desk .auth-form-panel h2 {
  font-family: var(--font-head, Syne, sans-serif);
  letter-spacing: -0.02em;
}

body.auth-desk .auth-visual {
  background:
    radial-gradient(ellipse at 70% 25%, rgba(46, 168, 85, 0.4), transparent 55%),
    linear-gradient(155deg, #0c1812, #145524 55%, #1a6b2e) !important;
}

body.auth-desk .site-wordmark,
body.auth-desk .brand-row {
  letter-spacing: 0.12em;
}

body.auth-desk .auth-links a {
  color: #22823a;
  font-weight: 700;
}

/* ---- Dashboard fine polish ---- */
body.dash-body .dash-content {
  animation: appFadeIn 0.35s var(--swa-ease);
}

@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

body.dash-body .dash-sidebar {
  border-right: 1px solid rgba(34, 130, 58, 0.12);
}

body.dash-body .theme-btn {
  border-radius: 11px;
}

/* ---- Mobile menu ---- */
.mobile-menu .menu-box {
  border-radius: 0 18px 18px 0;
  box-shadow: 20px 0 60px rgba(15, 40, 25, 0.2);
}

.mobile-menu .navigation a {
  border-radius: 10px;
  transition: background 0.2s;
}

.mobile-menu .navigation a:hover {
  background: rgba(34, 130, 58, 0.08);
  color: #145524;
}

/* ---- Pricing / plan cards ---- */
body.swa-desk .pricing-block.popular,
body.swa-desk .plan-card.featured,
body.dash-body .dash-plan-card.current {
  border-color: #22823a !important;
  box-shadow: 0 16px 40px rgba(34, 130, 58, 0.18) !important;
}

/* ---- Scrollbar (webkit) ---- */
body.swa-desk::-webkit-scrollbar,
body.dash-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
body.swa-desk::-webkit-scrollbar-thumb,
body.dash-body::-webkit-scrollbar-thumb {
  background: rgba(34, 130, 58, 0.35);
  border-radius: 999px;
}
body.swa-desk::-webkit-scrollbar-track,
body.dash-body::-webkit-scrollbar-track {
  background: #f0f5f1;
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Password rules checklist ---- */
.password-rules {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(34, 130, 58, 0.16);
  background: linear-gradient(165deg, #f7fbf8, #ffffff);
}

.pw-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.pw-rules-head strong {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #145524;
}

.pw-strength {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.pw-strength.pw-weak { background: #fdecea; color: #b42318; }
.pw-strength.pw-fair { background: #fff4e5; color: #b54708; }
.pw-strength.pw-good { background: #e8f5ec; color: #145524; }
.pw-strength.pw-strong { background: #22823a; color: #fff; }

.pw-rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.pw-rules-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #6a7a70;
}

.pw-rules-list li i {
  width: 1rem;
  color: #b7c4bc;
  font-size: 0.85rem;
}

.pw-rules-list li.ok {
  color: #145524;
  font-weight: 600;
}

.pw-rules-list li.ok i { color: #22823a; }
.pw-rules-list li.bad { color: #b42318; }
.pw-rules-list li.bad i { color: #b42318; }

.dash-skel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.dash-skel {
  height: 3.1rem;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(20, 85, 36, 0.06), rgba(20, 85, 36, 0.14), rgba(20, 85, 36, 0.06));
  background-size: 200% 100%;
  animation: dashSkel 1.1s ease-in-out infinite;
}
@keyframes dashSkel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---- Toasts + loading (sitewide) ---- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 1.5rem));
}
.toast {
  pointer-events: auto;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  background: #0f1a14;
  color: #f2f7f4;
  border: 1px solid rgba(125, 206, 160, 0.35);
  box-shadow: 0 12px 32px rgba(8, 20, 12, 0.35);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  animation: swaToastIn 0.28s var(--swa-ease, ease);
}
.toast.success {
  border-color: rgba(46, 180, 100, 0.65);
  background: linear-gradient(180deg, #123524, #0f1a14);
}
.toast.error {
  border-color: rgba(220, 80, 70, 0.7);
  background: linear-gradient(180deg, #3a1514, #1a1010);
}
.toast.info {
  border-color: rgba(70, 140, 200, 0.55);
}
@keyframes swaToastIn {
  from { transform: translateY(-8px) translateX(12px); opacity: 0; }
  to { transform: translateY(0) translateX(0); opacity: 1; }
}
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 12, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10060;
  display: none;
  place-items: center;
}
.loading-overlay.show { display: grid; }
.loading-overlay .spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(125, 206, 160, 0.25);
  border-top-color: #22823a;
  border-radius: 50%;
  animation: swaSpin 0.75s linear infinite;
}
@keyframes swaSpin {
  to { transform: rotate(360deg); }
}
