@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

/* ── Design tokens from app_theme.dart ── */
:root {
  --accent: rgb(26, 161, 164);       /* AppColors.accent */
  --accent-light: rgb(13, 184, 189); /* AppColors.accentLight */
  --bg: #ffffff;                      /* appBackgroundLight */
  --surface: #ffffff;                 /* sectionBackgroundLight */
  --text: #000000;                    /* primary text light */
  --text-muted: rgb(130, 130, 130);  /* secondaryLight */
  --section-radius: 32px;            /* Token.sectionCornerRadius */
  --modal-radius: 20px;              /* Token.modalCornerRadius */
  --field-height: 56px;              /* Token.fieldHeight */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;                     /* appBackgroundDark */
    --surface: rgb(24, 29, 34);       /* sectionBackgroundDark */
    --text: #ffffff;                   /* primary text dark */
    --text-muted: rgb(160, 160, 160); /* secondaryDark */
  }
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Landing page layout ── */
.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.landing-main {
  position: relative;
  z-index: 10;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

/* ── Background glows ── */
.glow-top {
  position: fixed;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(26, 161, 164, 0.06);
  filter: blur(100px);
  pointer-events: none;
  animation: glow-breathe 6s ease-in-out infinite;
}

.glow-bottom {
  position: fixed;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(26, 161, 164, 0.04);
  filter: blur(100px);
  pointer-events: none;
}

/* ── App icon ── */
.icon-wrapper {
  margin-bottom: 16px;
}

.icon-container {
  position: relative;
}

.icon-glow {
  position: absolute;
  inset: -16px;
  border-radius: 24px;
  background: rgba(26, 161, 164, 0.08);
  filter: blur(24px);
  animation: glow-breathe 6s ease-in-out infinite;
}

.icon-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--modal-radius);
  border: 1px solid rgba(26, 161, 164, 0.1);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.icon-box picture img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

@media (min-width: 768px) {
  .icon-box picture img {
    width: 88px;
    height: 88px;
  }
}

/* ── App name ── */
.app-name {
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #0a41a3 20%, #1daca8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .app-name { font-weight: 700; }
}

@media (prefers-color-scheme: dark) {
  .app-name {
    background: linear-gradient(135deg, #4a8fe7 20%, #2dd4d8 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* ── Tagline / typewriter ── */
.tagline-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  margin-bottom: 40px;
}

.tagline {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 0.75s step-end infinite;
  vertical-align: text-bottom;
}

/* ── Detail cards ── */
.detail-card-wrapper {
  width: 100%;
  max-width: 560px;
  margin-bottom: 16px;
}

.detail-card-wrapper:last-of-type {
  margin-bottom: 48px;
}

.detail-card {
  background: linear-gradient(135deg, rgba(26, 161, 164, 0.04) 0%, var(--surface) 100%);
  border: 1px solid rgba(26, 161, 164, 0.1);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  .detail-card {
    background: linear-gradient(135deg, rgba(26, 161, 164, 0.08) 0%, var(--surface) 100%);
    border-color: rgba(26, 161, 164, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

.detail-card p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .detail-card p { font-size: 1.05rem; }
}

/* ── Coming soon badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 9999px;
  border: 1px solid rgba(26, 161, 164, 0.15);
  background: rgba(26, 161, 164, 0.06);
  padding: 10px 20px;
  margin-bottom: 48px;
}

.badge-dot {
  position: relative;
  display: flex;
  width: 8px;
  height: 8px;
}

.badge-dot-ping {
  position: absolute;
  display: inline-flex;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.badge-dot-core {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.badge-text {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  color: var(--accent);
}

@media (min-width: 768px) {
  .badge-text { font-size: 1.1rem; }
}

@media (prefers-color-scheme: dark) {
  .badge {
    border-color: rgba(26, 161, 164, 0.35);
    background: rgba(26, 161, 164, 0.14);
  }
  .badge-text {
    color: var(--accent-light);
  }
  .badge-dot-core,
  .badge-dot-ping {
    background: var(--accent-light);
  }
}

/* ── Store buttons ── */
.store-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  justify-items: center;
}

.store-buttons .store-btn:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .store-buttons {
    display: flex;
    flex-direction: row;
    gap: 24px;
  }
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border-radius: 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: not-allowed;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  .store-btn {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}

@media (min-width: 420px) {
  .store-btn { padding: 12px 20px; }
}

@media (min-width: 768px) {
  .store-btn { padding: 20px 32px; min-width: 200px; }
}

.store-btn[disabled] {
  opacity: 0.7;
}

.store-btn:not([disabled]) {
  cursor: pointer;
}

.store-btn:not([disabled]):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.store-btn svg {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  flex-shrink: 0;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .store-btn svg {
    width: 32px;
    height: 32px;
    margin-right: 16px;
  }
}

.store-btn-label {
  text-align: left;
}

.store-btn-top {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .store-btn-top { font-size: 0.875rem; }
}

.store-btn-bottom {
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
  opacity: 0.7;
}

@media (min-width: 768px) {
  .store-btn-bottom { font-size: 1.125rem; }
}

/* ── Footer ── */
.landing-footer {
  position: relative;
  z-index: 10;
}

.footer-divider {
  margin: 0 auto;
  height: 1px;
  max-width: 200px;
  background: linear-gradient(to right, transparent, rgba(26, 161, 164, 0.2), transparent);
}

.footer-content {
  padding: 32px 24px;
  text-align: center;
}

.footer-copyright {
  margin-bottom: 14px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ── Flutter loading state ── */
.flutter-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.flutter-loading.active {
  display: flex;
}

.flutter-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(26, 161, 164, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.flutter-loading-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Animations ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation: fade-up 0.7s ease-out 0.1s both; }
.stagger-2 { animation: fade-up 0.7s ease-out 0.25s both; }
.stagger-3 { animation: fade-up 0.7s ease-out 0.4s both; }
.stagger-4 { animation: fade-up 0.7s ease-out 0.55s both; }
.stagger-5 { animation: fade-up 0.7s ease-out 0.7s both; }
.stagger-6 { animation: fade-up 0.7s ease-out 0.85s both; }
.stagger-7 { animation: fade-up 0.7s ease-out 1.0s both; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.icon-float { animation: float 5s ease-in-out infinite; }

@keyframes glow-breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.03); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Legal pages ── */
.legal-page {
  min-height: 100vh;
  background: var(--bg);
}

.legal-container {
  max-width: 768px;
  margin: 0 auto;
  padding: 64px 24px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.15s ease;
}

.legal-back:hover { color: var(--accent); }

.legal-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 48px;
}

.legal-content {
  line-height: 1.7;
  color: var(--text-muted);
}

.legal-content > p:first-child {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-bottom: 1.5rem;
}

.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(26, 161, 164, 0.12);
}

.legal-content > p:first-child + h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-content p {
  margin-bottom: 0.75rem;
}

.legal-content p:has(br) {
  background: rgba(26, 161, 164, 0.03);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.875rem 1.125rem;
  line-height: 1.8;
}

@media (prefers-color-scheme: dark) {
  .legal-content p:has(br) {
    background: rgba(26, 161, 164, 0.06);
  }
  .legal-content h2 {
    border-top-color: rgba(26, 161, 164, 0.2);
  }
}

.legal-content ul {
  list-style: none;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.legal-content ul li {
  margin-bottom: 0.3rem;
  position: relative;
  padding-left: 0.75rem;
}

.legal-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.legal-content a {
  color: var(--accent);
  text-decoration: none;
}

.legal-content a:hover { text-decoration: underline; }

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Auth callback page ── */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

.auth-container { padding: 2rem; }

.auth-container h1 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-fallback { margin-top: 1.5rem; }

.auth-fallback a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.auth-fallback a:hover { opacity: 0.9; }

.auth-close {
  margin-top: 1rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── Embed legal (no nav) ── */
.embed-legal {
  padding: 40px 24px;
}

.embed-legal .legal-title {
  font-size: 1.875rem;
  margin-bottom: 40px;
}
