/* Apex Soul — Phase 4.5 Design System */

/* === COLOR PALETTE === */
:root {
  --bg-base: #0A0913;
  --bg-elevated: rgba(29, 23, 53, 0.7);
  --bg-input: rgba(41, 33, 72, 0.88);
  --accent-red: #D32F4B;
  --accent-red-glow: #F24C68;
  --accent-gold: #E5B98A;
  --accent-indigo: #8275FF;
  --text-primary: #FCFBFA;
  --text-secondary: #E6DFF1;
  --text-muted: #BBB1CF;
  --border-subtle: rgba(229, 185, 138, 0.22);
  --glass-light: rgba(30, 24, 57, 0.72);
  --glass-border: rgba(229, 185, 138, 0.24);
  --gold: var(--accent-gold);
  --purple: var(--accent-indigo);
  --bg-card: var(--glass-light);
  --border: var(--glass-border);
  --text-body: var(--text-secondary);
  --text-heading: var(--text-primary);
}

/* Light Mode */
body[data-theme="light"] {
  --bg-base: #FFFDF9;
  --bg-elevated: #FFF8ED;
  --bg-input: #FFF9F0;
  --accent-red: #B92743;
  --accent-red-glow: #D73955;
  --accent-gold: #8A5A20;
  --accent-indigo: #4E3FC7;
  --text-primary: #171326;
  --text-secondary: #342C42;
  --text-muted: #5F566C;
  --border-subtle: rgba(138, 90, 32, 0.34);
  --glass-light: #FFF9F0;
  --glass-border: rgba(138, 90, 32, 0.30);
  --gold: var(--accent-gold);
  --purple: var(--accent-indigo);
  --bg-card: var(--glass-light);
  --border: var(--glass-border);
  --text-body: var(--text-secondary);
  --text-heading: var(--text-primary);
}

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top, rgba(130, 117, 255, 0.14), transparent 28%),
    linear-gradient(135deg, var(--bg-base) 0%, #171229 55%, #23173b 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top, rgba(229, 185, 138, 0.22), transparent 28%),
    linear-gradient(135deg, #FFFDF9 0%, #F7EFE3 56%, #F3E7D6 100%);
}

/* Sri Yantra SVG background */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  transform: translate(-50%, -50%);
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><defs><style>.yantra-line { stroke: %23E5B98A; stroke-width: 0.8; fill: none; opacity: 0.25; } .yantra-dot { fill: %23E5B98A; opacity: 0.35; }</style></defs><g transform="translate(200,200)"><circle cx="0" cy="0" r="180" class="yantra-line"/><circle cx="0" cy="0" r="160" class="yantra-line"/><circle cx="0" cy="0" r="140" class="yantra-line"/><circle cx="0" cy="0" r="120" class="yantra-line"/><circle cx="0" cy="0" r="100" class="yantra-line"/><circle cx="0" cy="0" r="80" class="yantra-line"/><polygon points="0,-150 130,75 -130,75" class="yantra-line"/><polygon points="0,-120 104,60 -104,60" class="yantra-line"/><polygon points="0,-100 87,50 -87,50" class="yantra-line"/><polygon points="150,0 -75,130 -75,-130" class="yantra-line"/><polygon points="120,0 -60,104 -60,-104" class="yantra-line"/><polygon points="100,0 -50,87 -50,-87" class="yantra-line"/><polygon points="0,150 -130,-75 130,-75" class="yantra-line"/><polygon points="0,120 -104,-60 104,-60" class="yantra-line"/><polygon points="0,100 -87,-50 87,-50" class="yantra-line"/><polygon points="-150,0 75,-130 75,130" class="yantra-line"/><polygon points="-120,0 60,-104 60,104" class="yantra-line"/><polygon points="-100,0 50,-87 50,87" class="yantra-line"/><circle cx="0" cy="0" r="6" class="yantra-dot"/></g></svg>') no-repeat center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

body > * {
  position: relative;
  z-index: 1;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent-indigo);
  text-decoration: none;
  transition: color 200ms ease-out;
}

a:hover {
  color: var(--accent-red-glow);
}

/* === LAYOUT === */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .container {
    max-width: 600px;
  }
}

/* === CARDS & GLASSMORPHISM === */
.card {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(20px);
  margin-bottom: 1.5rem;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

.card:hover {
  border-color: rgba(229, 185, 138, 0.34);
  transform: translateY(-1px);
}

body[data-theme="light"] .card,
body[data-theme="light"] .price-card,
body[data-theme="light"] .step,
body[data-theme="light"] .modal {
  background: #FFF9F0;
  border-color: rgba(138, 90, 32, 0.30);
  box-shadow: 0 16px 34px rgba(96, 65, 28, 0.12);
}

body[data-theme="light"] .section h2,
body[data-theme="light"] .price-card h3,
body[data-theme="light"] .free-check-kicker {
  color: var(--accent-gold) !important;
  -webkit-text-fill-color: initial;
}

body[data-theme="light"] .free-check-subheadline,
body[data-theme="light"] .free-check-advanced,
body[data-theme="light"] .free-check-fast-note,
body[data-theme="light"] .free-check-proof-row span,
body[data-theme="light"] .helper-text,
body[data-theme="light"] .form-note {
  color: var(--text-secondary) !important;
}

body[data-theme="light"] .free-check-proof-row span,
body[data-theme="light"] .free-check-fast-note,
body[data-theme="light"] .unknown-time-row {
  background: #FFF9F0 !important;
  border-color: rgba(138, 90, 32, 0.28) !important;
}

body[data-theme="dark"] .free-check-proof-row span {
  background: rgba(10, 9, 19, 0.62) !important;
  border-color: rgba(240, 201, 154, 0.45) !important;
  color: #FFF7EA !important;
}

body[data-theme="dark"] .free-check-fast-note {
  background: rgba(10, 9, 19, 0.68) !important;
  border-color: rgba(240, 201, 154, 0.42) !important;
  color: #FFF7EA !important;
}

body[data-theme="light"] .free-check-advanced summary,
body[data-theme="light"] .unknown-time-text span,
body[data-theme="light"] label span[style*="accent-gold"] {
  color: var(--accent-gold) !important;
}

body[data-theme="light"] .price-card.featured {
  background: #FFF4E4;
  border-color: rgba(138, 90, 32, 0.46);
}

.discount-pill {
  background: #F6D28A;
  border: 1px solid rgba(10, 9, 19, 0.16);
  border-radius: 6px;
  color: #171326;
  display: inline-block;
  font-size: 0.4em;
  font-weight: 800;
  line-height: 1.25;
  margin-left: 4px;
  padding: 2px 8px;
  vertical-align: middle;
}

.order-discount-pill {
  font-size: 0.86em;
  padding: 2px 7px;
}

body[data-theme="light"] .btn-primary {
  background: var(--accent-red);
  color: #fff;
}

body[data-theme="light"] .btn-secondary,
body[data-theme="light"] a:not(.btn) {
  color: var(--accent-indigo);
}

body[data-theme="light"] .theme-muted,
body[data-theme="light"] .opacity-70 {
  color: var(--text-muted);
  opacity: 1;
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease-out;
  text-align: center;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--accent-red);
  color: white;
  box-shadow: 0 4px 15px rgba(211, 47, 75, 0.3);
}

.btn-primary:hover {
  background: var(--accent-red-glow);
  color: #fff;
  box-shadow: 0 8px 25px rgba(211, 47, 75, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-indigo);
  border: 1px solid var(--accent-indigo);
  transition: all 200ms ease-out;
}

.btn-secondary:hover {
  background: rgba(130, 117, 255, 0.1);
  border-color: var(--accent-red-glow);
  color: var(--accent-red-glow);
}

.btn-ghost {
  background: rgba(130, 117, 255, 0.10);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #fff;
  box-shadow: 0 8px 20px rgba(78, 63, 199, 0.24);
}

.btn:focus-visible {
  outline: 3px solid rgba(229, 185, 138, 0.46);
  outline-offset: 3px;
}

body[data-theme="light"] .btn-primary:hover,
body[data-theme="light"] .btn-primary:focus-visible {
  background: #8F1E34 !important;
  border-color: #8F1E34 !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(143, 30, 52, 0.26) !important;
}

body[data-theme="light"] .btn-secondary:hover,
body[data-theme="light"] .btn-secondary:focus-visible {
  background: #4E3FC7 !important;
  border-color: #4E3FC7 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(78, 63, 199, 0.22) !important;
}

body[data-theme="light"] .btn-ghost {
  background: #F3EBDD !important;
  border-color: rgba(138, 90, 32, 0.32) !important;
  color: #171326 !important;
}

body[data-theme="light"] .btn-ghost:hover,
body[data-theme="light"] .btn-ghost:focus-visible {
  background: #171326 !important;
  border-color: #171326 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(23, 19, 38, 0.20) !important;
}

/* === FORMS === */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem;
  transition: all 200ms ease-out;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-indigo);
  background: rgba(130, 117, 255, 0.05);
  box-shadow: 0 0 12px rgba(130, 117, 255, 0.2);
}

input::placeholder {
  color: var(--text-muted);
}

/* Floating labels are opt-in only. A global sibling selector breaks checkbox rows. */
.floating-label {
  position: relative;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
  position: absolute;
  top: -1.25rem;
  left: 0;
  font-size: 0.8rem;
  color: var(--accent-indigo);
}

/* === HERO === */
.hero {
  padding: 3rem 1rem;
  text-align: center;
  margin-top: 2rem;
}

.hero h1 {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.free-check-page {
  padding-bottom: 3rem;
}

.free-check-hero {
  margin-top: 1rem;
}

.free-check-title {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  color: var(--text-primary);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

.free-check-subheadline {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-primary);
  opacity: 0.94;
}

.free-check-card {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.free-check-page label,
.free-check-page .checkbox-label,
.free-check-page .free-check-checkbox-label {
  color: var(--text-primary);
}

.free-check-page input::placeholder,
.free-check-page textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.free-check-page select,
.free-check-page input,
.free-check-page textarea {
  border-color: var(--glass-border);
}

.free-check-page footer p,
.free-check-page .subheadline,
.free-check-page .form-note,
.free-check-page .helper-text {
  color: var(--text-secondary);
}

body[data-theme="light"] .free-check-title {
  text-shadow: 0 2px 14px rgba(140, 112, 66, 0.12);
}

body[data-theme="light"] .free-check-card {
  box-shadow: 0 18px 40px rgba(120, 92, 56, 0.12);
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .cta-group {
    flex-direction: row;
    justify-content: center;
  }
}

/* === SECTIONS === */
.section {
  padding: 2rem 1rem;
  margin-bottom: 2rem;
}

.section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--accent-gold);
}

/* === STEPS === */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.step {
  text-align: center;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(30, 24, 57, 0.58);
  border: 1px solid var(--border-subtle);
  transition: all 300ms ease-out;
}

body[data-theme="light"] .step {
  background: #FFF9F0;
}

.step:hover {
  border-color: var(--accent-indigo);
  background: rgba(130, 117, 255, 0.1);
  transform: translateY(-4px);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-gold));
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: white;
}

/* === PRICING === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.price-card {
  background: var(--glass-light);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  backdrop-filter: blur(20px);
  transition: all 300ms ease-out;
}

.price-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(211, 47, 75, 0.2);
}

.price-card.featured {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(229, 185, 138, 0.14), rgba(29, 23, 53, 0.84));
}

.price-card.featured .tier-desc,
.price-card.featured .tier-features {
  color: var(--text-primary);
}

.price-card.featured .tier-badge.popular {
  background: #F6D28A;
  color: #171326;
  border: 1px solid rgba(10, 9, 19, 0.18);
  border-radius: 999px;
  display: inline-block;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
}

.guarantee-note,
.delivery-note {
  background: rgba(30, 24, 57, 0.62) !important;
  border: 1px solid rgba(229, 185, 138, 0.32) !important;
  color: var(--text-primary);
}

.guarantee-note p,
.delivery-note p {
  color: var(--text-primary) !important;
  opacity: 1 !important;
}

body[data-theme="light"] .guarantee-note,
body[data-theme="light"] .delivery-note {
  background: #FFF9F0 !important;
  border-color: rgba(138, 90, 32, 0.30) !important;
}

.price-card h3 {
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-red);
  margin: 1rem 0;
  font-family: 'Inter', sans-serif;
}

/* === MODAL / BOTTOM SHEET === */
.modal {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-light);
  border-top: 1px solid var(--glass-border);
  border-radius: 20px 20px 0 0;
  padding: 2rem 1rem;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  animation: slideUp 300ms ease-out;
  z-index: 100;
}

.modal.active {
  display: block;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* === FOOTER === */
footer {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: 3rem;
}

footer a {
  color: var(--accent-indigo);
}

/* === ANIMATIONS === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, rgba(130, 117, 255, 0.05) 50%, var(--bg-input) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: 8px;
}

/* === FAQ / ACCORDION === */
.faq-list {
  display: grid;
  gap: 0.85rem;
  max-width: 760px;
  margin: 1.5rem auto 0;
}

.faq-item {
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
  overflow: hidden;
}

.faq-trigger {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 1fr) 32px;
  min-height: 64px;
  padding: 1rem 1.05rem;
  -webkit-tap-highlight-color: transparent;
}

.faq-trigger strong {
  color: var(--text-primary);
  display: block;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.faq-arrow {
  align-items: center;
  background: rgba(10, 9, 19, 0.62);
  border: 1px solid rgba(229, 185, 138, 0.28);
  border-radius: 999px;
  color: #F6D28A;
  display: inline-flex;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease;
  width: 32px;
}

.faq-trigger.open .faq-arrow {
  background: #8F1E34;
  border-color: #8F1E34;
  color: #fff;
  transform: rotate(45deg);
}

.faq-content {
  color: var(--text-secondary);
}

.faq-content p {
  border-top: 1px solid var(--border-subtle);
  font-size: 0.96rem;
  line-height: 1.78;
  margin: 0;
  padding: 0.95rem 1.05rem 1.15rem;
}

.faq-content p + p {
  border-top: 0;
  padding-top: 0;
}

.faq-content strong {
  color: var(--text-primary);
}

.faq-content a {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.line-support-link {
  color: #6EE7A2;
  font-weight: 800;
}

body[data-theme="light"] .line-support-link {
  color: #047A38;
}

body[data-theme="light"] .faq-item {
  background: #FFF9F0;
  border-color: rgba(138, 90, 32, 0.30);
  box-shadow: 0 14px 30px rgba(96, 65, 28, 0.10);
}

body[data-theme="light"] .faq-arrow {
  background: rgba(138, 90, 32, 0.10);
  border-color: rgba(138, 90, 32, 0.26);
  color: #8A5A20;
}

@media (max-width: 520px) {
  .faq-list {
    gap: 0.72rem;
  }

  .faq-trigger {
    grid-template-columns: minmax(0, 1fr) 30px;
    min-height: 58px;
    padding: 0.92rem 0.95rem;
  }

  .faq-trigger strong {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .faq-arrow {
    height: 30px;
    width: 30px;
  }

  .faq-content p {
    font-size: 0.92rem;
    line-height: 1.82;
    padding: 0.85rem 0.95rem 1rem;
  }
}

/* === UTILITY === */
.text-center {
  text-align: center;
}

.text-accent {
  color: var(--accent-gold);
}

.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

.opacity-70 {
  opacity: 0.7;
}

.hidden {
  display: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 375px) {
  h1 { font-size: 1.75rem; }
  .container {
    padding: 0.75rem;
  }
  .card {
    padding: 1.5rem;
  }
}
