/*
 * apps/site/public/assets/style.css
 *
 * Shared styles for the sawa24.com marketing/invite site: home page, invite
 * landing page, 404 page. Plain CSS, no build step, no third-party fonts (system
 * font stack only, per CLAUDE.md's no-third-party-SDK rule extended to this site).
 *
 * Brand green (#0E7C66) matches apps/mobile/app.config.ts. Light/dark handled with
 * custom properties switched under prefers-color-scheme -- no toggle, the OS decides.
 */

:root {
  --brand: #0e7c66;
  --brand-contrast: #ffffff;
  --bg: #ffffff;
  --bg-elevated: #f4f6f5;
  --text: #16211d;
  --text-muted: #5b6a64;
  --border: #dfe6e3;
  --danger-bg: #fdecea;
  --danger-text: #7a271a;
  --focus-ring: #0e7c66;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Noto Sans", "Noto Sans Arabic", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #17a889;
    --brand-contrast: #04140f;
    --bg: #0e1512;
    --bg-elevated: #16201c;
    --text: #eef3f1;
    --text-muted: #a3b3ac;
    --border: #2a3a34;
    --danger-bg: #3a1a16;
    --danger-text: #ffb4a6;
    --focus-ring: #17a889;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* Direction is set on <html dir="rtl|ltr"> by assets/i18n.js. Nothing else in this
   file needs a [dir] selector: logical CSS properties (margin-inline-*, text-align:
   start) flip automatically. */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}

.card {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

.lang-toggle {
  align-self: flex-end;
  margin-inline-start: auto;
  margin-bottom: 24px;
}

.lang-toggle button {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.lang-toggle button:hover {
  border-color: var(--brand);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex: none;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
}

h1 {
  font-size: 22px;
  line-height: 1.35;
  margin: 0 0 8px;
}

.tagline {
  color: var(--text-muted);
  margin: 0 0 32px;
  font-size: 15px;
}

.subtitle {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 15px;
}

p {
  margin: 0 0 16px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 12px;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-contrast);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.step {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.step[hidden] {
  display: none;
}

.step-label {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  -webkit-user-select: all;
  user-select: all;
}

.copy-btn {
  flex: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.copy-btn.copied {
  border-color: var(--brand);
  color: var(--brand);
}

.expiry-note {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.error-box {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

.error-box p {
  margin: 0;
}

.error-box p.error-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.footer-link {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 24px;
  text-decoration: none;
}

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

[hidden] {
  display: none !important;
}

/*
 * Landing page (/) and legal doc pages (/legal/privacy, /legal/terms). These are
 * wider than the 420px app-style .card used by the home/invite/404 states above,
 * so they get their own wrapper classes instead of reusing .page/.card -- but they
 * still reuse .brand, .brand-name, .lang-toggle, .btn, .btn-primary, .footer-link
 * as-is, same tokens (--brand, --bg, --text, --border, ...), same no-inline-style
 * rule (CSP's style-src 'self' -- everything here is a class, never a style attribute).
 */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 880px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.site-header .brand {
  margin-bottom: 0;
  text-decoration: none;
  color: var(--text);
}

.brand-mark-svg {
  flex: none;
  display: block;
}

.landing {
  max-width: 880px;
  margin-inline: auto;
  padding: 0 16px;
}

.hero {
  padding: 40px 0 32px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1.25;
  margin: 0 0 16px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 620px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
}

.hero-actions .btn {
  width: auto;
  min-width: 220px;
}

.landing-section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.landing-section h2 {
  font-size: clamp(20px, 3.4vw, 26px);
  line-height: 1.3;
  margin: 0 0 16px;
  text-align: center;
}

.landing-section > p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.feature-icon {
  display: inline-flex;
  color: var(--brand);
  margin-bottom: 10px;
}

.feature h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.feature p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.privacy-readmore {
  display: block;
  text-align: center;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 16px;
}

.privacy-readmore:hover {
  text-decoration: underline;
}

.get-app {
  text-align: center;
}

.get-app .btn {
  width: auto;
  min-width: 260px;
  margin-inline: auto;
}

.beta-note {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.android-note {
  color: var(--text-muted);
  font-size: 13px;
  margin: 14px 0 20px;
}

.get-app .footer-link {
  margin-top: 4px;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding: 28px 16px 40px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-publisher {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

/* Legal doc pages: /legal/privacy, /legal/terms */

.doc {
  max-width: 680px;
  margin-inline: auto;
  padding: 32px 16px 56px;
}

.doc-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin: 4px 0 20px;
}

.doc-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.doc-intro {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.doc-section {
  margin-top: 28px;
}

.doc-section h2 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 8px;
}

.doc-section p {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0 0 10px;
}

.doc-section ul {
  margin: 0 0 10px;
  padding-inline-start: 20px;
}

.doc-section li {
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.doc-note {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.doc-ar-summary {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.doc-ar-summary h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.doc-ar-summary p,
.doc-ar-summary li {
  font-size: 14.5px;
  line-height: 1.8;
}

.doc-ar-summary ul {
  margin: 0 0 12px;
  padding-inline-start: 20px;
}

.doc-back {
  display: inline-block;
  margin-top: 32px;
  font-size: 14px;
  color: var(--brand);
  text-decoration: none;
}

.doc-back:hover {
  text-decoration: underline;
}
