/* The public pages, from Figma file FuLZVwAy8gQNRzXVF7dCKv: "Dashboard page" (1840:9774)
   at "/" and "Dashboard Detail page" (1843:10542) at /reports/<id>. Sizes are the
   design's at 1434px wide. Figma draws Thai text set in Noto Serif or Inter with
   Noto Sans Thai, so every Latin family falls back to it. */

@font-face {
  font-family: 'SACIT Noto Sans Thai';
  src: url('../fonts/NotoSansThai-thai.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'SACIT Noto Sans Thai';
  src: url('../fonts/NotoSansThai-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'SACIT Noto Serif';
  src: url('../fonts/NotoSerif-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-0E00, U+0E80-FFFF;
}

@font-face {
  font-family: 'SACIT Inter';
  src: url('../fonts/Inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-0E00, U+0E80-FFFF;
}

@font-face {
  font-family: 'SACIT Public Sans';
  src: url('../fonts/PublicSans-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Namaskarn';
  src: url('../fonts/Namaskarn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Namaskarn';
  src: url('../fonts/Namaskarn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --purple: #533193;
  --purple-active: #543293;
  --purple-dark: #311861;
  --purple-500: #6245b2;
  --purple-muted: #6b4fa1;
  --indigo: #565add;
  --teal: #00afb9;
  --green: #30b19d;
  --ink: #130034;
  --body: #4a4550;
  --surface: #f6f5f1;
  --surface-hover: #f1ecf7;
  --notes-bg: #f0edf8;
  --footer-bg: #3c157b;
  --error: #d92d20;
  --font-sans: 'SACIT Noto Sans Thai', system-ui, sans-serif;
  --font-serif: 'SACIT Noto Serif', 'SACIT Noto Sans Thai', serif;
  --font-inter: 'SACIT Inter', 'SACIT Noto Sans Thai', system-ui, sans-serif;
  --font-public: 'SACIT Public Sans', 'SACIT Noto Sans Thai', system-ui, sans-serif;
  --font-display: 'Namaskarn', 'SACIT Noto Sans Thai', serif;
  --gutter: 64px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

/* An embed grows from 600px to its dashboard's height after it loads; scroll anchoring
   would push the page down by that growth. */
html { overflow-anchor: none; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

.sp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sp-skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--purple);
  color: #fff;
  font-size: 14px;
  transform: translateY(-200%);
}

.sp-skip:focus { transform: none; }

/* Nav (Figma "Nav member") */

.sp-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
}

.sp-nav-inner {
  display: flex;
  align-items: center;
  max-width: 1434px;
  height: 91px;
  margin-inline: auto;
  padding-inline: 27px;
}

.sp-nav-logo {
  flex: 0 0 226px;
  height: 46px;
  overflow: hidden;
}

.sp-nav-logo img {
  width: 183px;
  height: 46px;
  margin-left: -8.98px;
}

.sp-nav-auth {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 15px;
}

.sp-nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 9999px;
  font-family: var(--font-inter);
  font-size: 14.8px;
  line-height: 26.917px;
  letter-spacing: 0.0815px;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 160ms var(--ease), background-color 160ms var(--ease);
  width: 111px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(85, 89, 221, 0.4);
}

.sp-nav-login span {
  background: linear-gradient(to bottom, var(--purple), #c3a5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sp-nav-login:hover { box-shadow: 0 0 0 2px rgba(85, 89, 221, 0.7); }

/* Header (Figma "Header - Hero Section") */

.sp-main { flex: 1 0 auto; }

.sp-hero {
  position: relative;
  isolation: isolate;
  min-height: 386px;
  padding: 123px 24px 48px;
  overflow: hidden;
  background: #fff;
  text-align: center;
}

/* Figma's header fill renders as this pattern, doubled and fading to white at the bottom
   left; the image the design export hands out for it is the card texture instead. */
.sp-hero::before,
.sp-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.sp-hero::before {
  background: url('../img/bg-pattern.svg') top / cover no-repeat;
  opacity: 0.7;
  transform: scale(2);
  transform-origin: top right;
}

.sp-hero::after {
  background-image: linear-gradient(10deg, #fff 0%, #fff 20%, rgba(255, 255, 255, 0) 100%);
}

.sp-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 1104px;
  margin-inline: auto;
}

.sp-hero-eyebrow {
  color: #000;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-transform: uppercase;
}

.sp-hero-eyebrow:empty { display: none; }

.sp-hero-title {
  padding-top: 8px;
  color: var(--purple-active);
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 500;
  line-height: 48px;
  letter-spacing: -1.2px;
}

.sp-hero-line { display: block; line-height: 62px; }

.sp-hero-accent { color: var(--teal); }

.sp-hero-desc {
  max-width: 852px;
  min-height: 26px;
  color: #000;
  font-size: 20px;
  line-height: 26px;
  opacity: 0.8;
}

/* Content (Figma "Export Dashboard Content") */

.sp-content {
  width: 100%;
  max-width: 1434px;
  margin-inline: auto;
  padding: 0 var(--gutter) 60px;
}

.sp-alert {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff1f0;
  color: #b42318;
  font-size: 14px;
}

/* Report cards (Figma "Artisan Card") */

.sp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 16px;
  margin: 0 0 76px;
  padding: 34px 0 0;
  list-style: none;
}

.sp-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  min-height: 317px;
  padding: 44px 24px;
  overflow: hidden;
  border: 1px solid rgba(24, 6, 58, 0.15);
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 4px 20px -2px rgba(87, 49, 147, 0.14);
  text-decoration: none;
  transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--ease);
}

.sp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../img/header-pattern.webp') center / cover no-repeat;
  opacity: 0.2;
}

.sp-card:hover {
  border-color: rgba(83, 49, 147, 0.35);
  box-shadow: 0 10px 28px -4px rgba(87, 49, 147, 0.24);
  transform: translateY(-2px);
}

.sp-card:focus-visible { outline-offset: 4px; }

.sp-card-sparkle {
  width: 43.5543px;
  height: 43.5543px;
  margin: 0.172px;
}

.sp-card-eyebrow {
  margin-top: 16px;
  color: var(--green);
  font-family: var(--font-serif);
  font-size: 10px;
  line-height: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sp-card-title {
  min-height: 40px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 20px;
  line-height: 20px;
}

.sp-card-range {
  min-height: 16.5px;
  margin-top: 32.1px;
  color: var(--purple-500);
  font-family: var(--font-inter);
  font-size: 15px;
  line-height: 16.5px;
  text-transform: uppercase;
}

.sp-card-more {
  margin-top: 21px;
  color: rgba(83, 49, 147, 0.5);
  font-family: var(--font-public);
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: color 200ms var(--ease);
}

.sp-card:hover .sp-card-more { color: var(--purple); }

/* Data Notes */

.sp-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 19px;
  border: 1px solid rgba(195, 165, 255, 0.2);
  border-radius: 12px;
  background: var(--notes-bg);
  color: var(--body);
  font-size: 13px;
  line-height: 20px;
}

.sp-notes-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--purple-dark);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.sp-notes-meta {
  color: var(--purple-muted);
  font-size: 12px;
  line-height: 18px;
}

/* Detail page */

.sp-report-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  padding-top: 40px;
}

.sp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(107, 79, 161, 0.2);
  border-radius: 9999px;
  background: #fff;
  filter: drop-shadow(0 4px 6px rgba(156, 164, 246, 0.15));
  color: var(--purple);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.sp-back:hover { border-color: rgba(107, 79, 161, 0.45); background: var(--surface-hover); }

/* Month picker: not in the design; it borrows the back button's pill. */

.sp-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
}

.sp-period-label {
  color: var(--purple-muted);
  font-size: 13px;
  line-height: 20px;
}

.sp-period-select {
  height: 40px;
  padding: 0 40px 0 16px;
  border: 1px solid rgba(107, 79, 161, 0.2);
  border-radius: 9999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23533193' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") right 16px center / 16px no-repeat;
  filter: drop-shadow(0 4px 6px rgba(156, 164, 246, 0.15));
  color: var(--purple);
  font: 600 14px/20px var(--font-sans);
  appearance: none;
  cursor: pointer;
}

.sp-period-select:hover { border-color: rgba(107, 79, 161, 0.45); }

.sp-period-submit {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9999px;
  background: var(--purple);
  color: #fff;
  font: 600 14px/20px var(--font-sans);
  cursor: pointer;
}

.sp-period-note {
  flex-basis: 100%;
  color: var(--purple-muted);
  font-size: 12px;
  line-height: 18px;
  text-align: right;
}

.sp-embed {
  position: relative;
  width: 100%;
  min-height: 600px;
  margin: 32px 0;
  overflow: hidden;
}

.sp-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.sp-embed-status {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #fff;
}

.sp-embed-status[hidden] { display: none; }

.sp-skeleton {
  display: grid;
  gap: 32px;
  animation: sp-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.sp-skeleton-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.sp-skeleton-lg { grid-template-columns: repeat(2, 1fr); }

.sp-skeleton-row > div {
  height: 190px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 12px;
  background: var(--surface-hover);
}

.sp-skeleton-lg > div { height: 328px; }

@keyframes sp-pulse { 50% { opacity: 0.55; } }

.sp-embed-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.sp-embed-error > div { max-width: 520px; }

.sp-error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 9999px;
  background: #fff1f0;
  color: var(--error);
  font-size: 20px;
  font-weight: 600;
}

.sp-embed-error h2 {
  margin-top: 16px;
  color: var(--purple-dark);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.sp-embed-error p {
  margin: 8px 0 24px;
  color: var(--body);
  font-size: 14px;
}

.sp-retry {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 9999px;
  background: var(--purple);
  color: #fff;
  font: 600 14px/20px var(--font-sans);
  cursor: pointer;
}

/* Newsletter band and footer (home page design, shared by every public page) */

.sp-newsletter {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 300px;
  margin-top: 72px;
  padding: 48px 40px;
  overflow: hidden;
  background: linear-gradient(180deg, #ece5fb 0%, #ddd1f6 100%);
  text-align: center;
}

.sp-newsletter-art {
  position: absolute;
  top: 0;
  z-index: -1;
  height: 100%;
  width: auto;
  pointer-events: none;
}

.sp-newsletter-art-left { left: 0; }
.sp-newsletter-art-right { right: 0; }

.sp-newsletter-title {
  color: var(--purple-dark);
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 400;
  line-height: 52px;
}

.sp-newsletter-title span { display: block; }

.sp-newsletter-accent { font-family: var(--font-display); letter-spacing: 1px; }

.sp-newsletter-desc {
  color: var(--purple-muted);
  font-size: 15px;
  line-height: 24px;
}

.sp-social {
  display: flex;
  gap: 18px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.sp-social img { width: 34px; height: 34px; }

.sp-footer {
  padding: 0 var(--gutter);
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.85);
}

.sp-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  max-width: 1306px;
  margin-inline: auto;
  padding: 26px 0;
  font-size: 13px;
  line-height: 20px;
}

.sp-footer-brand { display: flex; align-items: center; gap: 16px; }

.sp-footer-logo { flex-shrink: 0; width: 133px; height: 34px; }

.sp-footer-links { display: flex; gap: 40px; }

.sp-footer-links a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease);
}

.sp-footer-links a:hover { color: #fff; text-decoration: underline; }

.sp-footer-copy { justify-self: end; color: rgba(255, 255, 255, 0.7); font-size: 12px; text-align: right; }

/* Narrower screens keep the design's type and surfaces and fold the grid. */

@media (max-width: 1279px) {
  :root { --gutter: 40px; }
  .sp-newsletter-art { opacity: 0.55; }
}

@media (max-width: 1023px) {
  :root { --gutter: 32px; }
  .sp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-skeleton-row { grid-template-columns: repeat(2, 1fr); }
  .sp-skeleton-lg { grid-template-columns: 1fr; }
  .sp-footer-inner { grid-template-columns: 1fr; gap: 20px; padding-block: 32px; }
  .sp-footer-links { flex-wrap: wrap; gap: 12px 32px; }
  .sp-footer-copy { justify-self: start; text-align: left; }
}

@media (max-width: 767px) {
  .sp-nav-inner { height: 72px; padding-inline: 16px; }
  .sp-nav-logo { flex-basis: auto; height: 36px; }
  .sp-nav-logo img { width: 143px; height: 36px; margin-left: -7px; }
  .sp-nav-login { width: auto; height: 40px; padding-inline: 14px; font-size: 14px; }
  .sp-hero { min-height: 0; padding: 64px 16px 48px; }
  .sp-hero-title { font-size: 44px; line-height: 40px; letter-spacing: -0.8px; }
  .sp-hero-line { line-height: 46px; }
  .sp-hero-desc { font-size: 17px; line-height: 24px; }
  .sp-newsletter { min-height: 0; padding: 56px 16px; }
  .sp-newsletter-title { font-size: 28px; line-height: 40px; }
  .sp-newsletter-art { opacity: 0.3; }
}

@media (max-width: 639px) {
  :root { --gutter: 16px; }
  .sp-cards { grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; padding-top: 24px; }
  .sp-card { min-height: 0; padding: 32px 24px; border-radius: 24px; }
  .sp-card-range { margin-top: 20px; }
  .sp-card-title { min-height: 0; line-height: 28px; }
  .sp-hero-line { font-size: 34px; line-height: 42px; letter-spacing: -0.5px; }
  .sp-report-bar { padding-top: 24px; }
  .sp-period { justify-content: flex-start; }
  .sp-period-note { text-align: left; }
  .sp-skeleton-row { grid-template-columns: repeat(2, 1fr); }
  .sp-skeleton-row > div { height: 140px; }
}

@media (max-width: 380px) {
  .sp-nav-login { padding-inline: 10px; font-size: 13px; }
  .sp-hero-title { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-skeleton { animation: none; }
  .sp-card, .sp-card:hover { transform: none; }
}
