/* =============================================
   SPES Thai — Main Stylesheet
   Design tokens: UI-Standard.md
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #1E40FF;
  --brand-soft:   rgba(30, 64, 255, 0.10);
  --brand-border: rgba(30, 64, 255, 0.26);
  --success:      #10B981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning:      #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --text-main:    #111827;
  --text-muted:   #6B7280;
  --text-subtle:  #9CA3AF;
  --bg-base:      #FFFFFF;
  --bg-subtle:    #F9FAFB;
  --border:       #E5E7EB;
  --dark:         #0F172A;
  --dark-deep:    #1E3A5F;
  --dark-footer:  #111827;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-xl:    24px;
  --radius-pill:  100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  font-size: 16px;
  color: var(--text-main);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #1a35e0; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.20);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.18); }

/* --- NAV --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--success));
  flex-shrink: 0;
}
.logo-img {
  height: 60px;
  width: auto;
  display: block;
}
.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-main); }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: #F3F4F6;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.lang-btn:hover { background: var(--border); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s;
}

/* --- HERO --- */
.hero {
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark-deep) 100%);
  padding: 100px 80px;
}
.hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(30, 64, 255, 0.15);
  color: #BFDBFE;
  font-size: 13px;
  font-weight: 500;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.hero-title {
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -2px;
  line-height: 1.1;
  max-width: 900px;
}
.hero-sub {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-subtle);
  max-width: 680px;
  line-height: 1.65;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-stats {
  display: flex;
  gap: 48px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}
.stat-blue  { color: var(--brand); }
.stat-green { color: var(--success); }
.stat-white { color: #fff; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-subtle); }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.15); }

/* --- PRODUCTS --- */
.products {
  background: var(--bg-base);
  padding: 80px 80px;
}
.section-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.section-tag {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: #DBEAFE;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.tag-blue-outline {
  background: transparent;
  border: 1px solid rgba(30, 64, 255, 0.35);
  color: var(--brand);
}
.section-title {
  font-size: clamp(32px, 3.5vw, 48px);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -1px;
}
.section-sub {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
}

/* --- CARDS --- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
.card {
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card-dark {
  background: var(--dark);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
}
.card-tag {
  display: inline-flex;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}
.tag-blue   { background: var(--brand);   color: #fff; }
.tag-yellow { background: var(--warning); color: #fff; }
.tag-green  { background: var(--success); color: #fff; }

.card-name {
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
}
.card-desc {
  font-size: 15px;
  font-weight: 400;
  color: #9CA3AF;
  line-height: 1.65;
  flex: 1;
}
.card-feats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-feats li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #E5E7EB;
}
.feat-icon {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feat-blue   { background: var(--brand-soft);   color: var(--brand); }
.feat-yellow { background: var(--warning-soft); color: var(--warning); }
.feat-green  { background: var(--success-soft); color: var(--success); }

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  width: fit-content;
  transition: opacity 0.2s, transform 0.15s;
}
.card-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-blue   { background: var(--brand);   color: #fff; }
.btn-yellow { background: var(--warning); color: #fff; }
.btn-green  { background: var(--success); color: #fff; }

/* --- LANGUAGE SECTION --- */
.lang-section {
  background: var(--dark);
  padding: 72px 80px;
}
.lang-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.lang-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lang-title {
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1.1;
}
.lang-sub {
  font-size: 16px;
  color: #9CA3AF;
  line-height: 1.65;
  max-width: 480px;
}
.lang-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lang-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
}
.lang-card-active {
  background: rgba(30, 64, 255, 0.12);
  border: 1px solid rgba(30, 64, 255, 0.30);
}
.lang-flag {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.flag-yellow { background: var(--warning); }
.flag-blue   { background: var(--brand); }
.flag-green  { background: var(--success); }
.lang-card-label { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.lang-card-sub   { font-size: 12px; font-weight: 400; color: #9CA3AF; }

/* --- CTA SECTION --- */
.cta-section {
  background: var(--bg-subtle);
  padding: 80px 80px;
}
.cta-box {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-deep) 100%);
  border-radius: var(--radius-xl);
  padding: 72px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.cta-title {
  font-size: clamp(32px, 3.5vw, 52px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1.15;
}
.cta-sub {
  font-size: 17px;
  color: #9CA3AF;
  max-width: 560px;
  line-height: 1.65;
}

/* --- FOOTER --- */
.footer {
  background: var(--dark-footer);
  padding: 48px 80px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
}
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand .logo-text { color: #fff; }
.footer-tagline { font-size: 14px; color: var(--text-muted); line-height: 1.5; max-width: 260px; }
.footer-links { display: flex; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col-head { font-size: 12px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-col a:hover { color: #fff; }
.footer-col a.active { color: var(--brand); }
.footer-divider { height: 1px; background: rgba(255,255,255,0.08); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.lang-btn-footer {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}
.lang-btn-footer:hover { background: rgba(255,255,255,0.12); }

/* --- LANG SWITCH ACTIVE --- */
.lang-switch.active { color: var(--brand); font-weight: 600; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .nav-inner,
  .hero,
  .products,
  .lang-section,
  .cta-section,
  .footer { padding-left: 40px; padding-right: 40px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .cards .card:last-child { grid-column: span 2; max-width: 600px; margin: 0 auto; width: 100%; }
  .lang-inner { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 768px) {
  .nav-inner { padding: 0 20px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 72px;
    left: 0; right: 0;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 24px 24px 32px;
    gap: 20px;
    align-items: flex-start;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links .btn-primary { width: 100%; justify-content: center; }
  .hamburger { display: flex; }
  .hero { padding: 64px 20px; }
  .hero-title { font-size: 40px; letter-spacing: -1px; }
  .hero-stats { gap: 24px; }
  .stat-divider { display: none; }
  .products, .cta-section { padding: 56px 20px; }
  .section-inner { gap: 36px; }
  .cards { grid-template-columns: 1fr; }
  .cards .card:last-child { grid-column: span 1; max-width: 100%; }
  .lang-section { padding: 56px 20px; }
  .lang-inner { gap: 36px; }
  .cta-box { padding: 48px 24px; }
  .footer { padding: 40px 20px; }
  .footer-top { flex-direction: column; gap: 32px; }
  .footer-links { flex-wrap: wrap; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 16px; align-items: flex-start; }
}
