/* La7ch design system: light, modern SaaS. Tokens and components shared by the marketing site and the app. */

:root {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --faint: #94a3b8;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-soft-2: #e0e7ff;
  --accent-text: #4338ca;
  --accent-strong: var(--accent);
  --violet: #7c3aed;
  --sky: #0ea5e9;
  --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0ea5e9 100%);
  --gradient-soft: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(124,58,237,0.10) 50%, rgba(14,165,233,0.12));

  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #0284c7;
  --info-soft: #f0f9ff;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.05), 0 24px 48px -20px rgba(15, 23, 42, 0.22);
  --shadow-xl: 0 4px 8px rgba(15, 23, 42, 0.05), 0 40px 80px -24px rgba(15, 23, 42, 0.28);
  --ring: 0 0 0 4px rgba(79, 70, 229, 0.16);

  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

img { max-width: 100%; }

a { color: var(--accent-text); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.025em; line-height: 1.15; font-weight: 600; margin: 0 0 0.5em; }
h1 { letter-spacing: -0.035em; }

::selection { background: var(--accent-soft-2); color: var(--text); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }

code, kbd { font-family: var(--mono); font-size: 0.86em; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 650; font-size: 1.05rem; letter-spacing: -0.02em; }
.logo:hover { color: var(--text); }
.logo img { width: 28px; height: 28px; flex: none; display: block; border-radius: 8px; }

/* Text helpers */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.28rem 0.75rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-soft-2);
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.01em;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Layout helpers */
.row { display: flex; gap: 0.75rem; align-items: center; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.58rem 1rem; border-radius: var(--radius-sm);
  font: inherit; font-size: 0.9rem; font-weight: 550; line-height: 1.25; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.btn:hover { background: var(--bg-2); border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(79,70,229,0.3), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: 0 6px 16px -6px rgba(79,70,229,0.55), inset 0 1px 0 rgba(255,255,255,0.18); }

.btn-ghost { background: var(--surface); border-color: var(--border); box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-soft); border-color: #fca5a5; color: var(--danger); }

.btn-lg { padding: 0.8rem 1.35rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.84rem; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Forms */
label { display: block; font-size: 0.84rem; font-weight: 500; color: var(--text-2); margin-bottom: 0.4rem; }
input[type="text"], input[type="password"], input[type="url"], input[type="email"], input[type="tel"], input[type="search"], textarea, select, input[type="date"], input[type="time"] {
  width: 100%;
  padding: 0.62rem 0.8rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.93rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.field { margin-bottom: 1rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; color: var(--text-2); }

/* Alerts */
.error, .alert {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-soft-2); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; font-weight: 550; padding: 0.22rem 0.6rem; border-radius: 999px;
  text-transform: capitalize; letter-spacing: 0; border: 1px solid transparent; line-height: 1.3;
  background: var(--bg-3); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-running { background: var(--info-soft); color: var(--info); border-color: #bae6fd; }
.badge-running::before { animation: blink 1.2s ease-in-out infinite; }
.badge-done { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.badge-failed { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-soft-2); }
.badge .spinner { display: none; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.spinner { width: 0.75rem; height: 0.75rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Screenshot frame (filled by the screenshot() helper) */
.shot {
  position: relative; margin: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.shot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6); pointer-events: none; z-index: 1; }
.shot-chrome { display: flex; align-items: center; gap: 6px; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.shot-chrome i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.shot-url { margin-left: 0.75rem; flex: 1; max-width: 300px; font-size: 0.72rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0.18rem 0.75rem; text-align: center; }
.shot img { display: block; width: 100%; height: auto; }
.shot-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 1.5rem; text-align: center; color: var(--muted);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(79,70,229,0.10), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px),
    var(--bg-2);
  background-size: auto, 32px 32px, 32px 32px, auto;
}
.shot-placeholder .shot-label { color: var(--text); font-weight: 600; }
.shot-placeholder code { color: var(--accent-text); background: var(--accent-soft); padding: 0.15rem 0.5rem; border-radius: 6px; }
.shot-placeholder .shot-size { font-size: 0.75rem; color: var(--faint); }

/* Toasts (flash messages) */
.toasts { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: 0.6rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast {
  display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); color: var(--text); font-size: 0.9rem; line-height: 1.45;
  animation: toast-in 0.35s var(--ease) both;
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 0.4rem; background: var(--accent); }
.toast.is-error::before { background: var(--danger); }
.toast.is-success::before { background: var(--success); }
.toast .toast-close { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0.1rem; }
.toast .toast-close:hover { color: var(--text); }
.toast.is-leaving { animation: toast-out 0.3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(12px); } }

/* Shared keyframes */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes blob { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4%, 6%) scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
