/* ==========================================================================
   SHARELY - MAIN STYLES (main.css)
   Light & Dark Theme Design System, Full-Width Layout & Typography
   ========================================================================== */

:root {
  --bg-canvas: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8FAFC;
  --bg-surface-subtle: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.96);

  --border-subtle: #E2E8F0;
  --border-card: #CBD5E1;
  --border-focus: rgba(79, 70, 229, 0.6);

  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --color-accent: #4F46E5;
  --color-accent-hover: #4338CA;
  --color-accent-light: #EEF2FF;
  --color-accent-glow: rgba(79, 70, 229, 0.15);

  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-info: #0284C7;
  --color-info-bg: #F0F9FF;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.09), 0 8px 16px -4px rgba(15, 23, 42, 0.03);
  --shadow-3d: 0 25px 50px -12px rgba(79, 70, 229, 0.14), 0 12px 24px -6px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.9);

  --container-max: 100%;
  --header-height: 72px;
}

[data-theme="dark"] {
  --bg-canvas: #0B1120;
  --bg-surface: #111827;
  --bg-surface-elevated: #1E293B;
  --bg-surface-subtle: #1E293B;
  --bg-glass: rgba(15, 23, 42, 0.88);
  --bg-glass-card: rgba(17, 24, 39, 0.96);

  --border-subtle: #283548;
  --border-card: #334155;
  --border-focus: rgba(129, 140, 248, 0.65);

  --text-main: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --color-accent: #818CF8;
  --color-accent-hover: #6366F1;
  --color-accent-light: rgba(99, 102, 241, 0.16);
  --color-accent-glow: rgba(129, 140, 248, 0.22);

  --color-success: #34D399;
  --color-success-bg: rgba(16, 185, 129, 0.14);
  --color-warning: #FBBF24;
  --color-warning-bg: rgba(245, 158, 11, 0.14);
  --color-danger: #F87171;
  --color-danger-bg: rgba(239, 68, 68, 0.14);
  --color-info: #38BDF8;
  --color-info-bg: rgba(56, 189, 248, 0.14);

  --shadow-sm: 0 1px 3px rgba(2, 6, 23, 0.45), 0 1px 2px rgba(2, 6, 23, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(2, 6, 23, 0.55), 0 4px 10px -2px rgba(2, 6, 23, 0.35);
  --shadow-lg: 0 20px 40px -8px rgba(2, 6, 23, 0.65), 0 8px 16px -4px rgba(2, 6, 23, 0.4);
  --shadow-3d: 0 25px 50px -12px rgba(79, 70, 229, 0.22), 0 12px 24px -6px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(51, 65, 85, 0.9);
  color-scheme: dark;
}

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

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-canvas);
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  overflow-x: clip;
  overflow-y: auto;
}

[data-theme="dark"] html,
html[data-theme="dark"] {
  background-color: #0B1120;
  color-scheme: dark;
}

@supports not (overflow: clip) {
  html {
    overflow-x: hidden;
  }
}

/* View Transition API: Expanding Radial Ripple Theme Switch */
::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation: none;
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
  animation: ripple-expand 500ms ease-in-out forwards;
}

@keyframes ripple-expand {
  from {
    clip-path: circle(0px at var(--click-x) var(--click-y));
  }
  to {
    clip-path: circle(var(--ripple-radius) at var(--click-x) var(--click-y));
  }
}

html.is-theme-transitioning *,
html.is-theme-transitioning *::before,
html.is-theme-transitioning *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

body {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  padding-top: 76px;
  max-width: 100vw;
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layer 1: Soft ambient gradients on base canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: #FFFFFF;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(238, 242, 255, 0.65) 0%, rgba(255, 255, 255, 0) 50%),
    radial-gradient(circle at 88% 22%, rgba(241, 245, 249, 0.75) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(circle at 50% 50%, rgba(238, 242, 255, 0.45) 0%, rgba(255, 255, 255, 0) 65%),
    radial-gradient(circle at 18% 82%, rgba(241, 245, 249, 0.70) 0%, rgba(255, 255, 255, 0) 50%),
    radial-gradient(circle at 82% 85%, rgba(238, 242, 255, 0.55) 0%, rgba(255, 255, 255, 0) 55%);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  contain: strict;
}

[data-theme="dark"] body::before {
  background-color: #0B1120;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.14) 0%, rgba(11, 17, 32, 0) 50%),
    radial-gradient(circle at 88% 22%, rgba(37, 99, 235, 0.12) 0%, rgba(11, 17, 32, 0) 55%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08) 0%, rgba(11, 17, 32, 0) 65%),
    radial-gradient(circle at 18% 82%, rgba(30, 41, 59, 0.35) 0%, rgba(11, 17, 32, 0) 50%),
    radial-gradient(circle at 82% 85%, rgba(79, 70, 229, 0.12) 0%, rgba(11, 17, 32, 0) 55%);
}

/* Layer 2: Faint S logo watermarks tile */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none'%3E%3Cg transform='translate(40, 50) rotate(-8) scale(1.2)'%3E%3Crect width='40' height='40' rx='10' fill='rgba(79,70,229,0.02)' stroke='rgba(79,70,229,0.035)' stroke-width='1.2'/%3E%3Cpath d='M14 20C14 16.6863 16.6863 14 20 14H24M26 20C26 23.3137 23.3137 26 20 26H16' stroke='rgba(79,70,229,0.045)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M15 20H25' stroke='rgba(79,70,229,0.045)' stroke-width='2.0' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(340, 40) rotate(10) scale(0.8)'%3E%3Crect width='40' height='40' rx='10' fill='rgba(79,70,229,0.02)' stroke='rgba(79,70,229,0.035)' stroke-width='1.2'/%3E%3Cpath d='M14 20C14 16.6863 16.6863 14 20 14H24M26 20C26 23.3137 23.3137 26 20 26H16' stroke='rgba(79,70,229,0.045)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M15 20H25' stroke='rgba(79,70,229,0.045)' stroke-width='2.0' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(180, 240) rotate(-11) scale(1.35)'%3E%3Crect width='40' height='40' rx='10' fill='rgba(79,70,229,0.02)' stroke='rgba(79,70,229,0.035)' stroke-width='1.2'/%3E%3Cpath d='M14 20C14 16.6863 16.6863 14 20 14H24M26 20C26 23.3137 23.3137 26 20 26H16' stroke='rgba(79,70,229,0.045)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M15 20H25' stroke='rgba(79,70,229,0.045)' stroke-width='2.0' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(430, 280) rotate(7) scale(0.9)'%3E%3Crect width='40' height='40' rx='10' fill='rgba(79,70,229,0.02)' stroke='rgba(79,70,229,0.035)' stroke-width='1.2'/%3E%3Cpath d='M14 20C14 16.6863 16.6863 14 20 14H24M26 20C26 23.3137 23.3137 26 20 26H16' stroke='rgba(79,70,229,0.045)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M15 20H25' stroke='rgba(79,70,229,0.045)' stroke-width='2.0' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(60, 410) rotate(9) scale(1.5)'%3E%3Crect width='40' height='40' rx='10' fill='rgba(79,70,229,0.02)' stroke='rgba(79,70,229,0.035)' stroke-width='1.2'/%3E%3Cpath d='M14 20C14 16.6863 16.6863 14 20 14H24M26 20C26 23.3137 23.3137 26 20 26H16' stroke='rgba(79,70,229,0.045)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M15 20H25' stroke='rgba(79,70,229,0.045)' stroke-width='2.0' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(350, 430) rotate(-6) scale(0.7)'%3E%3Crect width='40' height='40' rx='10' fill='rgba(79,70,229,0.02)' stroke='rgba(79,70,229,0.035)' stroke-width='1.2'/%3E%3Cpath d='M14 20C14 16.6863 16.6863 14 20 14H24M26 20C26 23.3137 23.3137 26 20 26H16' stroke='rgba(79,70,229,0.045)' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M15 20H25' stroke='rgba(79,70,229,0.045)' stroke-width='2.0' stroke-linecap='round'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-position: 0 0;
  background-size: 520px 520px;
}

[data-theme="dark"] body::after {
  opacity: 0.45;
}

@media print {
  body::before,
  body::after {
    display: none !important;
  }
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-surface-subtle);
  color: var(--color-accent);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -999px;
  left: 20px;
  background: var(--color-accent);
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  top: 20px;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Full Width Section & Container System */
.full-width-section {
  width: 100%;
  max-width: 100%;
  position: relative;
}

.container {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 3.5vw, 48px);
  padding-right: clamp(16px, 3.5vw, 48px);
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .container {
    padding-left: clamp(24px, 4vw, 56px);
    padding-right: clamp(24px, 4vw, 56px);
  }
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding-top: calc(var(--header-height) + 16px);
  padding-bottom: 64px;
  box-sizing: border-box;
  opacity: 1;
  transform: none;
}

/* Mobile Layout & Readable Prose Scale (<= 767px) */
@media (max-width: 767px) {
  :root {
    --header-height: 54px;
  }

  html,
  body {
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body {
    padding-top: calc(56px + env(safe-area-inset-top));
  }

  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .main-content {
    padding-top: 12px !important;
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body,
  p,
  li,
  .home-hero-desc,
  .home-section-subtitle,
  .home-cta-desc,
  .home-guide-summary,
  .body-text {
    font-size: 14.5px;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .home-hero-title,
  .footer-page-title,
  .article-title,
  .hero-title,
  .page-title,
  .home-section-title,
  .section-title,
  .article-h2,
  .home-cta-title,
  .home-trust-title,
  .home-guide-title,
  .step-title,
  .section-h3 {
    line-height: 1.2 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  h1,
  .home-hero-title,
  .footer-page-title,
  .article-title,
  .hero-title,
  .page-title {
    font-size: 26px !important;
    letter-spacing: -0.02em !important;
  }

  h2,
  .home-section-title,
  .section-title,
  .article-h2,
  .home-cta-title {
    font-size: 21px !important;
    letter-spacing: -0.01em !important;
  }

  h3,
  .home-trust-title,
  .home-guide-title,
  .step-title,
  .section-h3 {
    font-size: 17.5px !important;
  }

  .poster-card-title,
  .card-title,
  .home-mockup-title {
    font-size: 15px !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
  }

  .poster-card-desc {
    font-size: 13px !important;
    line-height: 1.45 !important;
    word-break: break-word !important;
  }

  .home-tagline-kicker,
  .home-section-kicker,
  .footer-page-badge,
  .ad-label,
  .eyebrow,
  .badge-label,
  .meta-label,
  .footer-heading {
    font-size: 11px !important;
    letter-spacing: 0.08em !important;
  }

  button:not(.nav-dropdown-chevron):not(.toast button):not(.faq-question),
  .btn,
  .form-select,
  .form-input {
    min-height: 44px;
    box-sizing: border-box;
  }

  .btn,
  button:not(.faq-question):not(.seo-accordion-trigger):not(.nav-link):not(.theme-toggle-btn) {
    max-height: 52px;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

/* Smooth Transitions & Scroll Reveal */
.reveal-on-scroll {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .main-content {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Centered Loading Spinner */
.content-loading-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  width: 100%;
  grid-column: 1 / -1;
  opacity: 1;
  transform: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 32px 16px;
  box-sizing: border-box;
}

.content-loading-spinner-wrap.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.content-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--color-accent, #4F46E5);
  border-radius: 50%;
  animation: spinner-rotate 0.75s linear infinite;
  will-change: transform;
}

@keyframes spinner-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Unified Transparent Background for Content Bands */
section,
.full-width-section,
.home-section,
.home-section-alt,
.home-hero-section,
.home-quick-submit-section,
.home-quick-submit-wrap,
#home-popular-section,
#home-steps-section,
#home-trust-section,
#home-guides-section,
#home-cta-section,
.home-section:has(.home-cta-card),
.home-steps-body,
.how-it-works-collapsible,
.how-it-works-collapsible-inner,
.footer-page-hero,
.footer-page-wrapper,
.footer-page-body,
.content-section,
.legal-section,
.stage,
.main-content,
#main-content {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

section::before,
section::after,
.home-section::before,
.home-section::after,
.home-section-alt::before,
.home-section-alt::after,
.home-hero-section::before,
.home-hero-section::after,
.home-quick-submit-section::before,
.home-quick-submit-section::after,
.footer-page-hero::before,
.footer-page-hero::after,
#home-steps-section::before,
#home-steps-section::after,
.home-section:has(.home-cta-card)::before,
.home-section:has(.home-cta-card)::after,
.main-content::before,
.main-content::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

.animation-paused { animation-play-state: paused !important; }
