@import url("/assets/icons.css");
@import url("/assets/fonts.css");
@import url("/assets/theme-tokens.css");

/* Public pages: landing, privacy, terms, data deletion. Colors come from theme-tokens.css (dark by default,
   light with the toggle). Orange is kept for the main action and a few small accents. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: "Almarai", Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.8; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; top: -100px; right: 16px; z-index: 50; padding: 10px 14px; background: var(--surface); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.section-wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { width: min(1160px, 100% - 48px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 24px; font-weight: 800; line-height: 1.1; }
.site-brand img { width: 42px; height: 42px; border-radius: 10px; background: #011026; }
.site-brand small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 2px; color: var(--text-faint); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-links { display: flex; gap: 4px; margin-inline-end: 8px; }
.header-links a, .nav-login { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.header-links a:hover, .nav-login:hover { color: var(--text); background: var(--surface-3); }
.nav-login .ui-icon { width: 18px; height: 18px; }
.theme-toggle, .logout-button { height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle { width: 40px; padding: 0; }
.theme-toggle .ui-icon { width: 19px; height: 19px; }
.theme-toggle:hover, .logout-button:hover { background: var(--surface-3); }
.logout-button { padding: 0 14px; font-weight: 700; font-size: 14px; }
.logout-feedback { font-size: 13px; color: var(--danger-text); }

/* Buttons */
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s, border-color .15s; }
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
.button .ui-icon { width: 20px; height: 20px; }
.button-small { min-height: 40px; padding: 8px 16px; font-size: 14px; border-radius: 10px; }
.button-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.button-ghost:hover { background: var(--surface-3); border-color: var(--line-strong); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding: 72px 0 64px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 700; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.hero h1 { margin: 20px 0 16px; font-size: clamp(34px, 5vw, 54px); line-height: 1.35; font-weight: 800; letter-spacing: -.5px; }
.hero h1 span { color: var(--accent-text); }
.hero-description { margin: 0; max-width: 540px; font-size: 18px; color: var(--text-muted); line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: 14px; font-weight: 700; }
.hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.hero-points .ui-icon { width: 18px; height: 18px; color: var(--success); }

/* Chat example */
.chat-demo { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow), 0 30px 80px color-mix(in srgb, var(--accent) 7%, transparent); overflow: hidden; }
.chat-demo-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-demo-head strong { display: block; font-size: 15px; line-height: 1.3; }
.chat-demo-head small { color: var(--text-faint); font-size: 12px; }
.chat-demo-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #f58529, #dd2a7b 60%, #8134af); color: #fff; font-weight: 800; }
.chat-demo-live { margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--success-text); background: var(--success-bg); border: 1px solid var(--success-line); padding: 2px 10px; border-radius: 999px; }
.chat-demo-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface-2); }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.75; }
.from-customer { align-self: flex-end; background: var(--surface-3); border-end-end-radius: 4px; }
.from-iwan { align-self: flex-start; background: var(--accent); color: var(--on-accent); border-end-start-radius: 4px; }
.from-iwan b { font-weight: 800; }
.chat-demo-note { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--text-faint); }
.chat-demo-note .ui-icon { width: 15px; height: 15px; color: var(--success); }

/* Channels */
.channel-strip { border-block: 1px solid var(--line); background: var(--surface); }
.channel-inner { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 18px 0; flex-wrap: wrap; }
.channel-title { color: var(--text-faint); font-size: 14px; font-weight: 700; }
.channel-inner ul { display: flex; flex-wrap: wrap; gap: 14px 32px; margin: 0; padding: 0; list-style: none; }
.channel-inner li { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.channel-inner li img { width: 22px; height: 22px; }
.channel-inner small { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--text-muted); border: 1px solid var(--line-strong); }
.channel-inner small.ready { color: var(--success-text); border-color: var(--success-line); background: var(--success-bg); }

/* Section headings */
.section-heading { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.eyebrow { display: inline-block; color: var(--accent-text); font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.section-heading h2 { margin: 10px 0 12px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.4; font-weight: 800; letter-spacing: -.3px; }
.section-heading p { margin: 0; color: var(--text-muted); font-size: 17px; }

/* Features */
.features { padding: 96px 0 40px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-grid article { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: border-color .2s, transform .2s; }
.feature-grid article:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-text); }
.feature-icon .ui-icon { width: 24px; height: 24px; }
.feature-grid h3 { margin: 18px 0 6px; font-size: 19px; }
.feature-grid p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* Comparison */
.compare { padding: 64px 0; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 900px; margin-inline: auto; }
.compare-card { padding: 28px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.compare-card.is-iwan { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface)); }
.compare-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 20px; }
.compare-card h3 img { border-radius: 9px; background: #011026; }
.compare-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.compare-card li { position: relative; padding-inline-start: 28px; color: var(--text-muted); }
.compare-card li::before { content: "–"; position: absolute; inset-inline-start: 6px; color: var(--text-faint); font-weight: 800; }
.compare-card.is-iwan li { color: var(--text); }
.compare-card.is-iwan li::before { content: ""; top: 9px; width: 14px; height: 14px; inset-inline-start: 2px; background: var(--success); mask: url('/assets/icons/check.svg') center/contain no-repeat; -webkit-mask: url('/assets/icons/check.svg') center/contain no-repeat; }

/* Steps */
.steps-section { padding: 80px 0; background: var(--surface); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.steps li { padding: 26px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.step-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.steps h3 { margin: 16px 0 6px; font-size: 19px; }
.steps p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* FAQ */
.faq { padding: 88px 0 40px; }
.faq-list { max-width: 780px; margin-inline: auto; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 800; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-faint); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--text-muted); }

/* Closing */
.closing-cta { margin: 72px auto 96px; padding: 56px 32px; border-radius: 26px; text-align: center; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--surface); }
.closing-cta h2 { margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.4; }
.closing-cta p { margin: 0 auto; max-width: 520px; color: var(--text-muted); font-size: 17px; }
.closing-cta .hero-actions { justify-content: center; }

/* Contact popover */
.contact-popover { width: min(420px, calc(100% - 32px)); padding: 26px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.contact-popover::backdrop { background: rgba(0, 0, 0, .45); }
.contact-popover h2 { margin: 6px 0 8px; font-size: 22px; }
.contact-popover p { margin: 0; color: var(--text-muted); }
.contact-popover a { color: var(--text); overflow-wrap: anywhere; }
.popover-close { position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 20px; line-height: 1; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { width: min(1160px, 100% - 48px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px 0; }
.footer-brand { text-decoration: none; display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 14px; }
.footer-brand img { border-radius: 8px; background: #011026; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a, .footer-links button { color: var(--text-muted); text-decoration: none; font-size: 14px; background: none; border: 0; padding: 0; cursor: pointer; }
.footer-links a:hover, .footer-links button:hover { color: var(--text); }
.powered-card { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); text-decoration: none; }
.powered-card img { border-radius: 10px; background: #011026; }
.powered-card small { display: block; font-size: 10px; letter-spacing: 2px; color: var(--text-faint); font-weight: 700; line-height: 1.4; }
.powered-card strong { display: block; font-size: 15px; line-height: 1.4; }

/* Scroll reveal (landing.js) */
.scroll-reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal-pending { opacity: 0; transform: translateY(18px); }

/* Legal pages */
.legal-page { width: min(820px, 100% - 48px); margin: 48px auto 80px; overflow-wrap: anywhere; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; margin-bottom: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); width: fit-content; }
.legal-nav a { padding: 7px 14px; border-radius: 8px; text-decoration: none; color: var(--text-muted); font-weight: 700; font-size: 14px; }
.legal-nav a:hover { color: var(--text); background: var(--surface-3); }
.legal-nav a[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.legal-page h1 { margin: 0 0 6px; font-size: clamp(30px, 4vw, 40px); line-height: 1.35; }
.legal-updated { margin: 0 0 32px; color: var(--text-faint); font-size: 14px; }
.legal-lead { font-size: 18px; color: var(--text-muted); }
.legal-page h2 { margin: 36px 0 10px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 21px; }
.legal-page p, .legal-page li { color: var(--text-muted); font-size: 16px; line-height: 2; }
.legal-page ul { padding-inline-start: 22px; }
.legal-page li + li { margin-top: 6px; }
.legal-page a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 4px; }
.legal-contact { margin-top: 44px; padding: 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.legal-contact h2 { margin: 0 0 6px; padding: 0; border: 0; font-size: 18px; }
.legal-contact p { margin: 0 0 8px; }

/* Responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 48px 0; }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .header-links { display: none; }
}
@media (max-width: 640px) {
  .section-wrap, .header-inner, .footer-inner, .legal-page { width: calc(100% - 32px); }
  body { font-size: 15px; }
  .site-brand { font-size: 20px; }
  .site-brand img { width: 36px; height: 36px; }
  .site-brand small { display: none; }
  .header-actions { gap: 6px; }
  .nav-login, .button-small { white-space: nowrap; }
  .nav-login { padding: 8px 6px; font-size: 13px; }
  .button-small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
  .theme-toggle { width: 36px; height: 36px; }
  .header-inner { gap: 8px; }
  .hero-description, .section-heading p { font-size: 16px; }
  .hero-actions .button { flex: 1 1 100%; }
  .feature-grid, .compare-grid, .steps { grid-template-columns: 1fr; }
  .features, .faq { padding-top: 64px; }
  .steps-section { padding: 56px 0; }
  .closing-cta { padding: 40px 20px; margin: 48px auto 64px; }
  .chat-demo-body { padding: 14px; }
  .bubble { max-width: 90%; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
