/* LONA — shared tokens and primitives. Arabic RTL is the default; every rule uses logical properties. */

:root {
  color-scheme: light;

  /* Light Apple base with the promo video's pink/blue pastel wash */
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #ececf1;
  --line: #ebebf0;
  --line-strong: #d9d9e0;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #8e8e96;

  --ink: #1c1c1e;        /* the video's black capsules */
  --ink-2: #2c2c2e;
  --on-ink: #f5f5f7;

  --accent: #7c5cff;     /* Lona eyes */
  --accent-strong: #6a48f5;
  --accent-soft: rgba(124, 92, 255, 0.1);
  --accent-line: rgba(124, 92, 255, 0.3);
  --badge: #1ea7ff;      /* the video's "10m ago" pills */

  --pink-wash: #ffd6ea;
  --blue-wash: #cfeaff;

  --ok: #1f9d5c;
  --ok-soft: rgba(31, 157, 92, 0.1);
  --warn: #c27a00;
  --warn-soft: rgba(245, 160, 0, 0.13);
  --danger: #e0343b;
  --danger-soft: rgba(224, 52, 59, 0.09);

  /* Poppins for Latin (as in the video); Arabic glyphs fall through to Readex Pro, its geometric match */
  --font-display: "Poppins", "Readex Pro", system-ui, sans-serif;
  --font-ui: "Poppins", "Readex Pro", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-2xl: 44px;

  --shadow: 0 1px 2px rgba(20, 16, 40, 0.04), 0 14px 40px -14px rgba(40, 28, 90, 0.16);
  --shadow-lg: 0 2px 6px rgba(20, 16, 40, 0.05), 0 40px 80px -30px rgba(40, 28, 90, 0.28);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Arabic needs more leading, slightly larger size, and never letter-spacing. */
html[lang="ar"] body {
  font-size: 16.5px;
  line-height: 1.8;
}

html[lang="ar"] * {
  letter-spacing: 0 !important;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  line-height: 1.4;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding-inline: 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn-primary:hover {
  background: #000;
}

.btn-accent {
  background: var(--accent-strong);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: #fff;
}

.btn-quiet {
  background: transparent;
  color: var(--muted);
  padding-inline: 10px;
}

.btn-quiet:hover {
  color: var(--text);
}

.btn-sm {
  height: 34px;
  padding-inline: 14px;
  font-size: 0.87rem;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Directional icons flip in RTL; meaningful icons never do. */
html[dir="rtl"] .icon-dir {
  transform: scaleX(-1);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Pills, chips ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.no-dot::before {
  display: none;
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Brand mark ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

/* ---------- Language switch ---------- */

.lang-switch {
  height: 34px;
  min-width: 42px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 0.85rem;
  color: var(--muted);
}

.lang-switch:hover {
  color: var(--text);
}

/* ---------- Forms ---------- */

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.88rem;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 48px;
  padding-inline: 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.textarea {
  height: auto;
  min-height: 104px;
  padding-block: 14px;
  border-radius: var(--r-lg);
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

/* Toggle switch: the knob travels along the inline axis, so it mirrors in RTL. */
.switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.18s var(--ease);
  pointer-events: none;
}

.switch span::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: inset-inline-start 0.18s var(--ease);
}

.switch input:checked + span {
  background: var(--accent-strong);
}

.switch input:checked + span::after {
  inset-inline-start: 19px;
}

/* ---------- Chat bubbles (shared by landing mocks and the app) ---------- */

.bubble {
  max-width: 82%;
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 0.92rem;
  line-height: 1.65;
}

.bubble-them {
  align-self: flex-start;
  background: #e9e9ee;
  color: var(--text);
  border-end-start-radius: 8px;
}

.bubble-me {
  align-self: flex-end;
  background: var(--accent-strong);
  color: #fff;
  border-end-end-radius: 6px;
}

.bubble-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-block-start: 6px;
  font-size: 0.72rem;
  opacity: 0.75;
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px 16px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  animation: typing 1.1s infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@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;
  }
}

/* Round initial avatar, shared by landing mocks and the app */
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffc2de, #c5e4ff);
  color: #3b2a55;
  font-weight: 600;
  font-size: 0.9rem;
}

.live {
  height: 22px;
  padding-inline: 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.72rem;
  line-height: 22px;
}
