/* === General Styles === */
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Color tokens for light/dark mode */
:root {
  --bg: #f9f9fb;
  --text: #222222;
  --container-bg: #ffffff;
  --primary: #1676f3;
  --primary-rgb: 22,118,243;
  --primary-strong: #125ac0;
  --primary-strong-rgb: 18,90,192;
  --muted: #5c6f80;
  --panel-border: #e0e6ee;
  --footer-bg: rgba(246,248,252,0.80);
  --footer-color: #5c6f80;
  --modal-overlay: rgba(51,65,85,0.16);
  --modal-bg: rgba(255,255,255,0.97);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071018;
    --text: #e6eef9;
    --container-bg: #0f1720;
    --primary: #4ea3ff;
    --primary-rgb: 78,163,255;
    --primary-strong: #2186ff;
    --primary-strong-rgb: 33,134,255;
    --muted: #95aac1;
    --panel-border: rgba(255,255,255,0.04);
    --footer-bg: rgba(10,12,16,0.6);
    --footer-color: #9fb4c8;
    --modal-overlay: rgba(2,6,14,0.6);
    --modal-bg: rgba(8,12,18,0.84);
  }
}

/* apply the tokens */
body { background: var(--bg); color: var(--text); }

/* Ensure content doesn't get hidden behind ios safari home indicator / toolbar.
   Adds a small extra gap to account for browser controls that aren't included in the safe-area value. */
body {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
}
h1 {
  text-align: center;
  margin: 5px 0 20px 0 !important;
}
h2 {
  margin-top: 2.2em;
  margin-bottom: 0.8em;
  color: var(--primary);
  font-size: 1.25rem;
}
p, ul, li {
  font-size: 1.07rem;
  line-height: 1.7;
}
ul {
  margin-left: 1.4em;
}

/* === App Logo === */
.applogo-link {
  display: flex;
  justify-content: center;
  margin: 26px auto 6px auto;
  text-decoration: none;
}
.applogo {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
  width: fit-content;
  cursor: pointer;
  transition: filter 0.15s;
}
.applogo:hover, .applogo:focus {
  filter: brightness(1.08) drop-shadow(0 2px 8px rgba(var(--primary-rgb),0.2));
}
.applogo .appicon {
  width: 160px;
  height: 160px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  border-radius: 18px;
  object-fit: contain;
}
.applogo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}
.applogo-text-top {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  letter-spacing: -2px;
}
.applogo-text-id {
  font-size: 100px;
  font-weight: bold;
  color: var(--text);
  font-family: system-ui, sans-serif;
}
.applogo-text-sync {
  font-size: 100px;
  font-weight: bold;
  color: var(--primary);
  font-family: system-ui, sans-serif;
  margin-left: -4px;
}
.applogo-text-bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  margin-top: 5px;
}
.applogo-text-emoji {
  font-size: 26px;
  margin-right: 4px;
  vertical-align: middle;
}
.applogo-text-edition {
  font-size: 34px;
  margin-left: 2px;
  font-weight: 500;
  letter-spacing: 0px;
  vertical-align: middle;
}

/* === Container === */
.container {
  background: var(--container-bg);
  max-width: 900px;
  margin: 20px auto 20px auto;
  padding: 32px 28px 46px 28px;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  flex: 1 0 auto;
}
.center-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 0 auto;
  /* Avoid forcing viewport-height that can push the footer under mobile UI.
     Let flex layout determine height so footer appears after content. */
  min-height: 0;
  text-align: center;
}

/* App description block */
.app-desc {
  max-width: 760px; /* allow more horizontal breathing room */
  text-align: left;
  margin: 8px auto 4px auto;
  color: var(--text);
}
.app-desc .lead {
  font-size: 1.08rem;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}
.app-desc ul {
  margin-top: 6px;
  margin-bottom: 10px;
}
.app-desc .privacy-note {
  font-size: 0.96rem;
  color: var(--muted);
  margin-top: 8px;
}

/* App store badge / CTA */
.store-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px auto 2px auto; /* reduce space after description */
  justify-content: center;
  position: relative;
}
.app-store-badge {
  width: 160px;
  height: auto;
  filter: grayscale(0%);
  transition: transform 0.12s ease, filter 0.12s ease;
  cursor: default;
}
.store-note {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 600;
}
.store-cta:hover .app-store-badge {
  transform: translateY(-3px) scale(1.02);
}
.store-tooltip {
  position: absolute;
  bottom: -44px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(10,10,10,0.96);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.95rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 12;
}
.store-cta:hover .store-tooltip,
.store-cta:focus, .store-cta:focus-within .store-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Dark mode for the badge/tooltip when user prefers dark */
@media (prefers-color-scheme: dark) {
  .store-tooltip {
    background: rgba(20,24,28,0.92);
    color: #fff;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.04);
  }
  .app-store-badge {
    filter: grayscale(60%) brightness(1.25) contrast(1);
  }
}

/* === Main Button and Contact Button === */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.actions button {
  flex: 0 1 260px; /* buttons share same base width */
  min-width: 180px;
}
.main-btn {
  padding: 14px 22px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(22, 118, 243, 0.10);
  transition: background 0.18s, transform 0.12s;
  letter-spacing: 0.3px;
}
.main-btn:hover, .main-btn:focus {
  background: var(--primary-strong);
  transform: translateY(-2px);
}
.contact-btn {
  padding: 12px 18px;
  background: rgba(255,255,255,0.92);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.02rem;
  border: 1.25px solid rgba(209,227,250,0.95);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 8px rgba(22, 118, 243, 0.06);
  transition: background 0.18s, color 0.18s, border 0.18s;
  letter-spacing: 0.3px;
}
.contact-btn:hover, .contact-btn:focus {
  background: rgba(231,240,250,0.9);
  color: var(--primary-strong);
  border-color: rgba(176,199,233,0.9);
}

/* Responsive: stack actions on small screens */
@media (max-width: 520px) {
  .actions {
    flex-direction: column;
    gap: 10px;
    /* ensure buttons stretch to container edges on small screens */
    align-items: stretch;
  }
  .actions button {
    width: 100%;
    min-width: 0;
    /* don't let the flex-basis from desktop become the button height
       when the container is vertical; make buttons size to content */
    flex: 0 0 auto;
    /* make buttons a comfortable tappable height */
    min-height: 44px;
    padding: 12px 16px;
    height: auto;
  }
}

/* Mid-size tweaks: reduce logo scale, tighten spacing, and equalize button heights */
@media (max-width: 980px) {
  .applogo-link {
    margin: 18px auto 6px auto; /* slightly smaller top spacing */
  }
  .applogo .appicon {
    width: 120px;
    height: 120px;
    border-radius: 14px;
  }
  .applogo {
    gap: 6px;
  }
  .applogo-text-id, .applogo-text-sync {
    font-size: 80px; /* scale down big headline text */
  }
  .applogo-text-edition {
    font-size: 18px;
  }

  /* Reduce vertical gap between store badge and description */
  .store-cta {
    margin: 4px auto 4px auto;
  }
  .app-desc {
    margin-top: 6px;
  }

  /* Make action buttons visually consistent at tablet/mid widths */
  .actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* consistent tappable / visual height */
    min-height: 56px;
    padding: 14px 22px;
    height: auto;
  }
  /* ensure both buttons use the exact same vertical padding */
  .main-btn, .contact-btn {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

/* === Footer Styles === */
.page-content {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
}

.site-footer {
  width: 100%;
  /* allow for device safe area (iOS notch / home indicator) */
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: transparent;
  position: relative;
  z-index: 6;
}
.footer-link {
  flex-shrink: 0;
  width: 100%;
  text-align: center;
  padding: 20px 0 14px 0;
  background: var(--footer-bg);
  backdrop-filter: blur(6px) saturate(160%);
  font-size: 1.15rem;
  color: var(--footer-color);
  letter-spacing: 1.1px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
  user-select: none;
  font-family: system-ui, sans-serif;
  opacity: 0.86;
  border-top: 1px solid var(--panel-border);
  box-shadow: 0 -2px 24px rgba(22, 118, 243, 0.04);
  transition: color 0.18s, background 0.18s, opacity 0.18s;
  display: block;
}
.footer-link:hover, .footer-link:focus {
  background: rgba(218, 228, 241, 0.93);
  color: var(--primary);
  opacity: 1;
  text-decoration: underline;
}

/* === Contact Modal Styles === */
.modal-bg {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: var(--modal-overlay);
  backdrop-filter: blur(3.5px);
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.modal-bg.active {
  display: flex;
}
.modal-content {
  background: var(--modal-bg);
  border-radius: 20px;
  box-shadow: 0 8px 48px rgba(22, 118, 243, 0.18);
  padding: 36px 30px 30px 30px;
  max-width: 410px;
  width: 90vw;
  position: relative;
  animation: modalFadeIn 0.25s;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96);}
  to { opacity: 1; transform: translateY(0) scale(1);}
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s;
  z-index: 1;
}
.modal-close:hover, .modal-close:focus {
  color: var(--primary);
}
.modal-content h2 {
  margin-top: 0;
  margin-bottom: 22px;
  color: var(--primary);
  font-size: 1.28rem;
  text-align: center;
  font-weight: bold;
}
/* Contact Form Styling inside modal */
.form-group { margin-bottom: 1.1em; }
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 1em;
}
.col { flex: 1; }
.form-control {
  width: 100%;
  padding: 11px 10px;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 6px;
  margin-bottom: 0;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
}
.form-control:focus {
  border: 1.5px solid var(--primary);
  background: rgba(246,250,255,0.04);
}
textarea.form-control {
  min-height: 90px;
  resize: vertical;
}
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.18s;
}
.btn:hover, .btn:focus {
  background: var(--primary-strong);
}

/* === Privacy Banner Styles === */
.privacy-banner {
  /* use theme tokens so the banner adapts to light/dark modes */
  background: color-mix(in srgb, var(--container-bg) 90%, transparent);
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  max-width: 800px;
  margin: 24px auto 32px auto;
  padding: 28px 32px 24px 32px;
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
}
.privacy-banner__headline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.privacy-banner__headline {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.privacy-banner__headline-icon {
  margin-top: 2px;
}
.privacy-banner__desc {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 18px;
  margin-left: 2px;
}
.privacy-banner__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
  color: var(--text);
  margin-bottom: 6px;
  margin-left: 2px;
}

/* Ensure SVG icons inside the privacy banner follow the theme colors. 
   Use !important to override presentation attributes in the inline SVGs. */
.privacy-banner svg path,
.privacy-banner svg rect,
.privacy-banner svg line {
  fill: var(--text) !important;
  stroke: var(--text) !important;
}
/* Keep the red "no" line clearly red even in dark mode */
.privacy-banner svg line[stroke="#e74c3c"],
.privacy-banner svg line[stroke="#e74c3c"] * {
  stroke: #e74c3c !important;
}

/* Form controls: keep the translucent look but make text visible in dark mode */
.form-control,
textarea.form-control {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
}
.form-control::placeholder,
textarea.form-control::placeholder {
  color: var(--muted);
  opacity: 0.9;
}
/* iOS/WebKit text fill for inputs */
.form-control, textarea.form-control {
  -webkit-text-fill-color: var(--text);
}

/* Dark-mode specific fallbacks for banner and inputs in older browsers */
@media (prefers-color-scheme: dark) {
  .privacy-banner {
    /* subtle translucent dark surface to contrast with page background */
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  }
  /* ensure all SVG children inherit theme colors */
  .privacy-banner svg *,
  .privacy-banner svg path,
  .privacy-banner svg rect,
  .privacy-banner svg line {
    fill: var(--text) !important;
    stroke: var(--text) !important;
  }

  /* inputs: keep translucent background but ensure readable text */
  .form-control,
  textarea.form-control {
    background: rgba(255,255,255,0.02) !important;
    color: var(--text) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--primary) !important;
  }
  .form-control::placeholder,
  textarea.form-control::placeholder {
    color: rgba(255,255,255,0.6) !important;
    opacity: 0.95;
  }
}
.privacy-banner__icon {
  display: flex;
  align-items: center;
}
@media (max-width: 600px) {
  .privacy-banner {
    padding: 16px 7px 12px 7px;
  }
  .privacy-banner__headline {
    font-size: 1.08rem;
  }
  .privacy-banner__desc,
  .privacy-banner__row {
    font-size: 0.97rem;
  }
}

/* === Responsive === */
@media (max-width: 900px) {
  .applogo .appicon { width: 110px; height: 110px; }
  .applogo-text-id, .applogo-text-sync { font-size: 70px; }
  .applogo-text-edition { font-size: 22px; }
  .applogo-text-emoji { font-size: 18px; }
  .main-btn { font-size: 1.2rem; padding: 14px 32px; }
  .contact-btn { font-size: 1rem; padding: 10px 18px; }
  .container { padding: 16px 3vw 30px 3vw; }
  .modal-content { padding: 20px 7vw 20px 7vw; }
}
@media (max-width: 600px) {
  .applogo .appicon { width: 90px; height: 90px; }
  .applogo-text-id, .applogo-text-sync { font-size: 55px; }
  .applogo-text-sync { margin-left: -2px; }
  .applogo-text-top { letter-spacing: -1px; }
  .applogo-text-edition { font-size: 14px; }
  .applogo-text-emoji { font-size: 11px; }
  .main-btn { font-size: 1rem; padding: 11px 16px; }
  .contact-btn { font-size: 0.97rem; padding: 10px 14px; }
  .footer-link { font-size: 0.97rem; padding: 14px 0 20px 0; }
  .container { padding: 8vw 2vw 18vw 2vw; }
  /* small horizontal buffer inside the centered container for very small screens */
  .center-container { padding-inline: 3vw; }
}

.container > .contact-btn {
  display: block;
  margin: 22px auto 0 auto;
  padding: 14px 26px;
  font-size: 1.06rem;
  font-weight: 800;
  min-width: 220px;
  box-shadow: 0 6px 18px rgba(22,118,243,0.12);
}
.container > .contact-btn:hover, .container > .contact-btn:focus {
  transform: translateY(-2px);
}