/* Flowday website — design tokens lifted 1:1 from lib/theme/app_theme.dart.
   Component styling stays inline in the markup (as in the design handoff);
   this file adds the tokens, the states inline styles cannot express
   (:hover, :focus-visible, media queries) and the contact form. */

:root {
  color-scheme: light;

  --accent: #5B5CD9;
  --accent-soft: rgba(91, 92, 217, 0.10);
  --accent-softer: rgba(91, 92, 217, 0.06);
  --accent-text: #3A3B9E;

  --bg: #F6F6F9;
  --card: #FFFFFF;
  --input: #EFF0F5;
  --fg: #1A1B23;
  --muted: #6C6E80;
  --outline: #DDDEE7;
  --hairline: rgba(26, 27, 35, 0.06);
  --chip: rgba(26, 27, 35, 0.045);
  --card-border: transparent;
  --nav-surface: #FFFFFF;

  --shadow-soft: 0 12px 28px -8px rgba(52, 55, 96, 0.06), 0 2px 6px -2px rgba(52, 55, 96, 0.04);
  --shadow-lift: 0 22px 44px -14px rgba(52, 55, 96, 0.12), 0 3px 8px -3px rgba(52, 55, 96, 0.05);
  --shadow-nav: 0 12px 30px -6px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 9px 22px -4px rgba(91, 92, 217, 0.38);

  --prio-red: #E5484D;
  --prio-amber: #DD8D0A;
  --prio-slate: #64748B;
  --green: #30A46C;

  --r-card: 22px;
  --r-control: 16px;
  --r-button: 18px;
  --r-sheet: 32px;
  --page-inset: 24px;

  --font: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
}

[data-theme='dark'] {
  color-scheme: dark;

  --accent: #8183F4;
  --accent-soft: rgba(129, 131, 244, 0.18);
  --accent-softer: rgba(129, 131, 244, 0.10);
  --accent-text: #C9CAFB;

  --bg: #0E0F13;
  --card: #191A21;
  --input: #23242C;
  --fg: #EAEAF2;
  --muted: #9EA0B2;
  --outline: #2C2D36;
  --hairline: rgba(234, 234, 242, 0.06);
  --chip: rgba(234, 234, 242, 0.07);
  --card-border: rgba(255, 255, 255, 0.04);
  --nav-surface: #1C1D25;

  --shadow-soft: 0 10px 22px -8px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 20px 40px -12px rgba(0, 0, 0, 0.55);
  --shadow-nav: 0 12px 30px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 9px 22px -4px rgba(129, 131, 244, 0.38);

  --prio-red: #F2555A;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding-left: 1.15em; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease, opacity 0.2s ease; }
a:hover { color: var(--fg); }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

svg { display: block; }

/* Keyboard focus — visible everywhere, never on mouse clicks. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link for keyboard and screen-reader users. */
[data-skip-link] {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-button);
  background: var(--card);
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
  transition: top 0.2s ease;
}
[data-skip-link]:focus { top: 12px; color: var(--fg); }

/* Language switch: both versions live in the markup, one is hidden. */
[data-lang] { display: none; }
[data-lang='en'] { display: revert; }
html[data-site-lang='de'] [data-lang='en'] { display: none; }
html[data-site-lang='de'] [data-lang='de'] { display: revert; }

/* Theme-dependent icon pairs (sun / moon) */
[data-icon='dark'] { display: none; }
html[data-theme='dark'] [data-icon='dark'] { display: block; }
html[data-theme='dark'] [data-icon='light'] { display: none; }

/* Current page in the nav */
[aria-current='page'] { color: var(--fg); font-weight: 700; }

/* Language segmented control state */
[data-lang-option] { color: var(--muted); transition: color 0.2s ease, background-color 0.25s ease; }
[data-lang-option]:hover { color: var(--fg); }
[data-lang-option][data-active='true'] {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ------------------------------------------------------------------
   Hover states
   In the design prototype these were `style-hover="…"` attributes,
   which only that runtime understands. Here they are real CSS.
   ------------------------------------------------------------------ */

.fd-btn-primary {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.fd-btn-primary:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 16px 34px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}
.fd-btn-primary:active { transform: translateY(0) scale(0.99); }

.fd-btn-secondary { transition: color 0.2s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.fd-btn-secondary:hover { color: var(--accent); transform: translateY(-2px); }
.fd-btn-secondary:active { transform: translateY(0); }

.fd-card-hover {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.fd-card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  color: var(--fg);
}

.fd-nav-link:hover { color: var(--fg); background: var(--chip); }

.fd-footer-link:hover { color: var(--accent); }

.fd-theme-toggle { transition: color 0.2s ease, transform 0.2s ease; }
.fd-theme-toggle:hover { color: var(--fg); transform: translateY(-1px); }

.fd-logo:hover { color: var(--fg); }

/* Prose links inside body copy stay underlined so they read as links. */
.fd-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.fd-prose a:hover { color: var(--accent-text); }

/* ------------------------------------------------------------------
   Responsive chrome + mobile menu
   The design hid the nav below 640px without replacing it; this is the
   replacement, so Support / Privacy / Imprint stay reachable on phones.
   ------------------------------------------------------------------ */

/* !important is required throughout: the markup carries inline styles (kept
   from the design handoff), and inline styles outrank plain stylesheet rules. */
@media (max-width: 860px) {
  [data-site-header] nav { gap: 0 !important; }
  [data-site-header] nav a { padding: 8px 8px !important; font-size: 13.5px !important; }
}

[data-menu-toggle] { display: none; }

@media (max-width: 640px) {
  [data-site-header] nav { display: none !important; }
  [data-menu-toggle] {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    color: var(--muted);
    flex: none;
    transition: color 0.2s ease;
  }
  [data-menu-toggle]:hover { color: var(--fg); }
}

/* Very narrow phones: tighten the header so logo + controls still fit. */
@media (max-width: 420px) {
  [data-site-header] > div {
    padding-left: 16px !important;
    padding-right: 16px !important;
    gap: 12px !important;
  }
  .fd-logo-sub { display: none !important; }
  [data-mobile-menu] a { padding-left: 16px; padding-right: 16px; }
}

[data-mobile-menu] {
  display: none;
  border-top: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
}
[data-mobile-menu][data-open='true'] { display: block; }
@media (min-width: 641px) {
  [data-mobile-menu] { display: none !important; }
}
[data-mobile-menu] a {
  display: block;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--hairline);
}
[data-mobile-menu] a:last-child { border-bottom: 0; }
[data-mobile-menu] a:hover { background: var(--chip); }

/* FAQ disclosure */
details summary svg { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
details[open] summary svg { transform: rotate(45deg); }
details[open] > p { animation: flowday-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
summary:hover { color: var(--accent); }

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  filter: blur(6px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal][data-in] { opacity: 1; transform: none; filter: none; }

/* Scroll progress line */
[data-scroll-progress] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 90;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), var(--accent));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Pointer spotlight on cards */
[data-spotlight] { position: relative; isolation: isolate; }
[data-spotlight]::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 68%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  z-index: -1;
}
[data-spotlight]:hover::before { opacity: 1; }

/* Parallax hook */
[data-parallax] { transform: translate3d(0, var(--parallax, 0px), 0); will-change: transform; }

/* Phone tilt */
[data-tilt] { perspective: 1400px; }
[data-tilt] > * {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
}

/* Play-Store button states */
[data-play-store][data-store-state='soon'] [data-store-live] { display: none; }
[data-play-store][data-store-state='live'] [data-store-soon] { display: none; }

/* ------------------------------------------------------------------
   Contact form
   ------------------------------------------------------------------ */

[data-contact-form] { display: flex; flex-direction: column; gap: 18px; }

.fd-field { display: flex; flex-direction: column; gap: 7px; }

.fd-field > label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--fg);
}

.fd-field .fd-req { color: var(--accent); }

.fd-input,
.fd-textarea,
.fd-select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--input);
  border: 1px solid transparent;
  border-radius: var(--r-control);
  padding: 13px 15px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.fd-input { height: 50px; }
.fd-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.fd-select {
  height: 50px;
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236C6E80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
html[data-theme='dark'] .fd-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239EA0B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
}

.fd-input::placeholder,
.fd-textarea::placeholder { color: var(--muted); opacity: 0.75; }

.fd-input:hover,
.fd-textarea:hover,
.fd-select:hover { border-color: var(--outline); }

.fd-input:focus,
.fd-textarea:focus,
.fd-select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.fd-field[data-invalid='true'] .fd-input,
.fd-field[data-invalid='true'] .fd-textarea,
.fd-field[data-invalid='true'] .fd-select {
  border-color: var(--prio-red);
}
.fd-field[data-invalid='true'] .fd-input:focus,
.fd-field[data-invalid='true'] .fd-textarea:focus,
.fd-field[data-invalid='true'] .fd-select:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--prio-red) 18%, transparent);
}

.fd-error {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--prio-red);
}
.fd-field[data-invalid='true'] .fd-error { display: block; }

/* Consent checkbox */
.fd-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  cursor: pointer;
}
.fd-consent input[type='checkbox'] {
  appearance: none;
  width: 21px;
  height: 21px;
  flex: none;
  margin: 1px 0 0;
  border: 2px solid var(--outline);
  border-radius: 7px;
  background: var(--card);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.fd-consent input[type='checkbox']:hover { border-color: var(--accent); }
.fd-consent input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.fd-field[data-invalid='true'] .fd-consent input[type='checkbox'] { border-color: var(--prio-red); }

/* Honeypot — hidden from people, visible to naive bots. */
.fd-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Submit button + busy state */
.fd-submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}
.fd-submit[data-busy='true'] { opacity: 0.72; pointer-events: none; }
.fd-submit [data-submit-idle],
.fd-submit [data-submit-busy] { display: inline-flex; align-items: center; gap: 10px; }
.fd-submit[data-busy='false'] [data-submit-busy] { display: none; }
.fd-submit[data-busy='true'] [data-submit-idle] { display: none; }

.fd-spinner {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: flowday-spin 0.7s linear infinite;
}

/* Result banner */
[data-form-status] { display: none; }
[data-form-status][data-state='success'],
[data-form-status][data-state='error'] {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 17px 19px;
  border-radius: var(--r-control);
  font-size: 14.5px;
  line-height: 1.6;
  animation: flowday-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
[data-form-status][data-state='success'] {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}
[data-form-status][data-state='error'] {
  background: color-mix(in srgb, var(--prio-red) 12%, transparent);
  color: var(--prio-red);
}
[data-form-status] [data-status-success] { display: none; }
[data-form-status] [data-status-error] { display: none; }
[data-form-status][data-state='success'] [data-status-success] { display: block; }
[data-form-status][data-state='error'] [data-status-error] { display: block; }

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

/* Aurora blobs behind the hero */
[data-aurora] {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  animation: flowday-drift 22s ease-in-out infinite;
}
[data-aurora='b'] { animation-duration: 28s; animation-direction: reverse; }

@keyframes flowday-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(6%, -5%, 0) scale(1.12); }
  66% { transform: translate3d(-5%, 4%, 0) scale(0.94); }
}

@keyframes flowday-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

/* Live demo loop inside the phone mockup */
@keyframes fd-demo-ring {
  0%, 30% { background: transparent; box-shadow: none; }
  40%, 90% { background: var(--prio-red); box-shadow: 0 2px 12px color-mix(in srgb, var(--prio-red) 45%, transparent); }
  100% { background: transparent; box-shadow: none; }
}
@keyframes fd-demo-check {
  0%, 32% { opacity: 0; transform: scale(0.3); }
  44%, 90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.3); }
}
@keyframes fd-demo-strike {
  0%, 34% { transform: scaleX(0); }
  48%, 90% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}
@keyframes fd-demo-dim {
  0%, 32% { opacity: 1; }
  46%, 90% { opacity: 0.55; }
  100% { opacity: 1; }
}
@keyframes fd-demo-bar {
  0%, 30% { width: 25%; }
  46%, 90% { width: 50%; }
  100% { width: 25%; }
}
@keyframes fd-demo-out {
  0%, 30% { opacity: 1; }
  42%, 90% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes fd-demo-in {
  0%, 30% { opacity: 0; }
  42%, 90% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fd-demo-cursor {
  0%, 22% { opacity: 0; transform: translate(14px, 18px) scale(1); }
  28% { opacity: 1; transform: translate(0, 0) scale(1); }
  36% { opacity: 1; transform: translate(0, 0) scale(0.82); }
  44% { opacity: 1; transform: translate(0, 0) scale(1); }
  56%, 100% { opacity: 0; transform: translate(-6px, -12px) scale(1); }
}
@keyframes fd-demo-ripple {
  0%, 34% { opacity: 0; transform: scale(0.6); }
  40% { opacity: 0.5; transform: scale(1); }
  52%, 100% { opacity: 0; transform: scale(1.9); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  [data-aurora], [data-demo], [data-float] { animation: none !important; }
  [data-tilt] > * { transform: none; }
  .fd-spinner { animation-duration: 2s; }
}

@media (max-width: 620px) {
  [data-tilt] > * { transform: none; }
}

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

@keyframes flowday-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
