@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap");

/* ========================================
   ROOT VARIABLES
======================================== */
:root {
  --primary: #ffb92a;
  --primary-hover: #f5a623;
  --secondary: #592b8a;
  --text-on-primary: #ffffff;
  --bg: #ffffff;
  --surface-soft: #f8f5ff;
  --muted: #615a6f;
  --text: #201237;
  --text-strong: #171022;
  --border-soft: rgba(32, 18, 55, 0.08);
  --shadow-soft: 0 18px 44px rgba(32, 18, 55, 0.08);
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

/* ========================================
   GLOBAL / RESET
======================================== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: var(--font-body);
  background: var(--secondary);
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 185, 42, 0.35);
  color: var(--text-strong);
}

a {
  color: var(--secondary);
}

img {
  max-width: 100%;
  display: block;
}

.card,
.registration-card {
  background: var(--bg);
}

/* ========================================
   BASE LAYOUT
======================================== */
main {
  max-width: 520px;
  margin: 16px auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  main {
    max-width: 680px;
    margin: 24px auto;
  }
}

@media (min-width: 1024px) {
  main {
    max-width: 800px;
    margin: 32px auto;
  }
}

@media (min-width: 700px) {
  main {
    padding: 24px;
  }
}

/* ========================================
   HEADER
======================================== */
header {
  background: var(--secondary);
  color: var(--text-on-primary);
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}

@media (min-width: 768px) {
  header {
    padding: 20px 24px;
  }

  header h1 {
    font-size: 1.4rem;
  }
}

/* ========================================
   BUTTONS / INTERACTIVE
======================================== */
button#loginButton,
button#continueButton,
button#manageBtn,
button#openPortalBtn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--primary);
  color: var(--text-on-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

button#loginButton:hover,
button#continueButton:hover,
button#manageBtn:hover,
button#openPortalBtn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 185, 42, 0.3);
}

button#loginButton:active,
button#continueButton:active,
button#manageBtn:active,
button#openPortalBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 185, 42, 0.2);
}

.header-logout-btn {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-on-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.header-logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.header-logout-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

button:focus-visible,
.button-link:focus-visible,
a:focus-visible,
.mobile-menu-toggle:focus-visible,
.scroll-top-btn:focus-visible {
  outline: 3px solid rgba(255, 185, 42, 0.38);
  outline-offset: 3px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(32, 18, 55, 0.12);
}

.button-link.primary {
  background: var(--primary);
  color: var(--text-strong);
}

.button-link.secondary {
  background: rgba(255, 255, 255, 0.75);
  color: var(--secondary);
  border-color: rgba(89, 43, 138, 0.2);
}

/* ========================================
   CARDS / FORMS / ALERTS
======================================== */
.registration-card {
  width: 100%;
  margin: 16px auto;
  padding: 24px 20px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.card-header h2 {
  margin: 0;
  flex: 1;
}

.alert {
  max-width: 520px;
  margin: 16px auto 0;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef5350;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #66bb6a;
}

@media (min-width: 768px) {
  .alert {
    max-width: 680px;
  }
}

/* ========================================
   LOADER
======================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   FOOTER
======================================== */
footer {
  margin-top: 32px;
  padding: 40px 20px;
  background: var(--secondary);
  color: rgba(255, 255, 255, 0.8);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.footer-section h4 {
  margin: 0 0 12px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.footer-section p {
  margin: 0 0 8px;
  line-height: 1.6;
}

.footer-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-section li {
  margin-bottom: 6px;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-section a:hover {
  color: var(--primary);
}

.footer-logo {
  max-width: 120px;
  height: auto;
}

.contact-detail {
  margin: 0;
}

.footer-section .contact-detail {
  text-align: left;
}

.footer-section .contact-detail a {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

footer p:last-child {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

/* ========================================
   UTILITIES
======================================== */
.small {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ========================================
   HOME PAGE FOUNDATION
======================================== */
.home-page {
  background:
    radial-gradient(
      circle at top left,
      rgba(89, 43, 138, 0.14),
      transparent 34%
    ),
    radial-gradient(
      circle at top right,
      rgba(255, 185, 42, 0.18),
      transparent 30%
    ),
    linear-gradient(180deg, #fff8e6 0%, #ffffff 34%, #f7f3ff 100%);
}

.section-purple {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 20px;
  background: var(--secondary);
  padding: 20px;
  display: grid;
  gap: 24px;
}

.section-purple-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
  display: grid;
  gap: 24px;
}

.section-purple .content-panel,
.section-purple .app-download-box {
  margin: 0;
}

.home-shell {
  display: grid;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hero-panel,
.content-panel,
.audience-card {
  background: #ffffff;
  border: 1px solid rgba(32, 18, 55, 0.08);
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(32, 18, 55, 0.08);
}

.content-panel {
  padding: 24px;
}

.partner-section {
  margin-top: -18px;
}

.about-section {
  margin-top: 2px;
}

.section-title {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.section-copy {
  margin: 0;
  color: #4f4860;
  line-height: 1.7;
}

.eyebrow,
.brand-kicker {
  font-family: var(--font-body);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(89, 43, 138, 0.1);
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ========================================
   TOP BAR / BRANDING
======================================== */
.site-topbar {
  width: 100%;
  margin: 0;
  padding: 0;
}

.site-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 84px;
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 26px rgba(32, 18, 55, 0.12));
}

.brand-kicker {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 700;
}

.brand-name {
  margin: 4px 0 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.1;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ========================================
   MOBILE MENU
======================================== */
.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-on-primary);
}

.mobile-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  min-width: 180px;
  padding: 14px;
  border: 1px solid rgba(32, 18, 55, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 34px rgba(32, 18, 55, 0.18);
}

.mobile-menu-panel .button-link {
  width: 100%;
}

.mobile-menu-panel .button-link.secondary {
  background: rgba(89, 43, 138, 0.08);
}

/* ========================================
   HERO
======================================== */
.hero-panel {
  display: grid;
  align-items: center;
  gap: 24px;
  padding: 4px;
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-copy .eyebrow {
  margin-top: 12px;
}

.hero-copy h2 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.hero-copy p {
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #4f4860;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-note {
  margin: 4px 0 0;
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(
    135deg,
    rgba(89, 43, 138, 0.08),
    rgba(255, 185, 42, 0.18)
  );
}

.hero-image img {
  width: min(100%, 420px);
  height: auto;
}

/* ========================================
   CONTENT GRIDS / CARDS
======================================== */
.stat-grid,
.feature-grid,
.audience-grid,
.how-it-works-grid,
.partners-grid {
  display: grid;
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.how-it-works-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.partners-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.feature-grid {
  margin-top: 18px;
}

.how-it-works-section {
  margin-top: 0;
}

.feature-card,
.stat-card,
.audience-card,
.step-card,
.partner-card {
  padding: 20px;
}

.feature-card,
.stat-card,
.step-card,
.partner-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(32, 18, 55, 0.05);
}

.feature-card h4,
.stat-card h4,
.audience-card h3,
.step-card h4,
.partner-card h4 {
  margin: 0 0 10px;
  color: var(--secondary);
  font-family: var(--font-display);
}

.feature-card p,
.stat-card p,
.audience-card p,
.step-card p,
.partner-card p {
  margin: 0;
  color: #4f4860;
  line-height: 1.65;
}

.audience-grid {
  margin-top: 18px;
}

.audience-card {
  display: grid;
  gap: 14px;
}

.audience-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.micro-list {
  margin: 0;
  padding-left: 18px;
  color: #4f4860;
  line-height: 1.7;
}

.split-note {
  color: var(--secondary);
  font-weight: 700;
}

/* ========================================
   APP DOWNLOAD BOX
======================================== */
.app-download-box {
  margin-top: 24px;
  margin-bottom: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(32, 18, 55, 0.05);
}

.app-title {
  color: var(--secondary);
}

.app-download-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.app-download-left {
  display: flex;
  flex-direction: column;
}

.app-description {
  margin-top: 12px;
  margin-bottom: 16px;
  color: #4f4860;
}

.app-download-btn {
  margin-top: 8px;
}

.app-store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.app-qr {
  margin-top: 0px;
}

.app-qr img {
  width: 180px;
  height: auto;
  padding: 6px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (min-width: 760px) {
  .hero-panel {
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
    gap: 32px;
    align-items: center;
  }

  .hero-image {
    min-height: auto;
    width: fit-content;
    justify-self: center;
    align-self: center;
  }

  .hero-copy {
    align-content: center;
  }

  .hero-copy h2 {
    max-width: 12ch;
  }

  .hero-copy p {
    max-width: 58ch;
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .site-topbar-inner {
    gap: 12px;
    padding: 16px 12px 0;
    align-items: flex-start;
  }

  .brand-lockup {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .brand-mark {
    width: 58px;
  }

  .brand-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .brand-name {
    font-size: 1.05rem;
    line-height: 1.05;
  }

  .desktop-actions {
    display: none;
  }

  .mobile-menu {
    display: block;
    flex: 0 0 auto;
  }

  .hero-panel {
    padding: 16px;
    gap: 18px;
  }

  .hero-image {
    padding: 12px;
    border-radius: 20px;
  }

  .hero-image img {
    width: 100%;
    max-width: 320px;
    height: auto;
  }

  .hero-copy h2 {
    font-size: clamp(2rem, 8vw, 2.6rem);
    line-height: 1.02;
  }

  .hero-copy p {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.65;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
  }

  .hero-actions .button-link {
    width: 100%;
  }

  .section-purple {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: 12px;
    background: var(--secondary);
    border-radius: 0;
    padding: 20px 0;
    display: grid;
    gap: 20px;
  }

  .section-purple-inner {
    padding: 0 12px;
    gap: 20px;
  }

  .app-download-box {
    padding: 18px;
    margin-top: 0;
  }

  .app-download-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .app-store-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .app-store-buttons .button-link {
    width: 100%;
  }

  .app-qr {
    display: flex;
    justify-content: center;
  }

  .app-qr img {
    width: 180px;
    max-width: 100%;
  }

  .how-it-works-grid,
  .stat-grid,
  .feature-grid,
  .partners-grid {
    grid-template-columns: 1fr;
  }

  .partner-section,
  .about-section {
    margin-top: 0;
  }

  .scroll-top-btn {
    right: 16px;
    bottom: 16px;
  }
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none;
  }
}

/* ========================================
   FLOATING SCROLL BUTTON
======================================== */
.scroll-top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--primary);
  color: var(--secondary);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 16px 30px rgba(32, 18, 55, 0.22);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.scroll-top-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(32, 18, 55, 0.26);
  filter: brightness(1.02);
}

.scroll-top-btn:active {
  transform: translateY(0);
}
