/* photoediti — shared tokens, components and site pages */
:root {
  color-scheme: dark;
  --ink: #0F1115; --ink-2: #0B0D10; --panel: #191C22; --surface: #23272F; --line: #2E333C;
  --text: #F3F4F6; --soft: #C9CDD4; --muted: #9AA1AD;
  --coral: #FF5A3C; --coral-2: #FF7A5F; --on-coral: #2A0A03; --blue: #3D8BFF; --teal: #19C3A6; --danger: #F05252;
  --r: 10px; --r-lg: 16px;
  --font: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
[dir=rtl] { --font: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--ink); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--coral-2); }
a:hover { color: var(--coral); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.grow { flex: 1; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 9px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--coral); color: var(--on-coral); }
.btn-primary:hover { background: #ff6d52; color: var(--on-coral); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #2b3039; color: var(--text); }
.btn-danger { background: transparent; color: #ff8f8f; border-color: #5b2a2a; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16px; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-xs { min-height: 28px; padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--soft); cursor: pointer; }
.icon-btn:hover { background: var(--surface); color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 38px; color: var(--text); }
input[type=checkbox] { accent-color: var(--coral); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--coral); }
kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

/* brand */
.brand, .brand-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand-word { font-size: 18px; letter-spacing: -0.03em; }
.brand-word .w1 { font-weight: 500; color: var(--soft); }
.brand-word .w2 { font-weight: 800; color: var(--text); }

/* site layout */
.site-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 14px clamp(16px, 4vw, 48px); background: rgba(15,17,21,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.site-nav nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav nav a { color: var(--soft); text-decoration: none; font-weight: 500; font-size: 14px; }
.site-nav nav a:hover { color: var(--text); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.hero { padding: clamp(48px, 9vw, 110px) 0 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 18px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--soft); max-width: 560px; margin: 0 0 28px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 14px; color: var(--muted); font-size: 13px; }
.hero-shot { direction: ltr; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.hero-shot .bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.hero-shot .bar b { color: var(--text); }
.hero-shot svg { display: block; width: 100%; height: auto; }
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; margin: 0 0 10px; }
.section > .container > p.sub { color: var(--soft); max-width: 640px; margin: 0 0 32px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.feature h3 { margin: 10px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--soft); font-size: 14px; }
.feature .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #2a1a17; color: var(--coral-2); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: s; }
.step { padding: 22px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--mono); color: var(--coral-2); }
.step h3 { margin: 8px 0 4px; }
.step p { margin: 0; color: var(--soft); font-size: 14px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 900px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral) inset; }
.plan h3 { margin: 0; font-size: 20px; }
.plan .price { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--soft); }
.plan li::before { content: '✓'; color: var(--teal); font-weight: 800; margin-inline-end: 8px; }
.toggle { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.toggle button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--soft); font-weight: 700; min-height: 36px; }
.toggle button.on { background: var(--coral); color: var(--on-coral); }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--soft); margin: 10px 0 0; }
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .container { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--soft); }
.lang-sel { min-height: 34px; padding: 4px 8px; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--soft); }
.auth-card .err { color: #ff9b9b; font-size: 14px; min-height: 20px; margin: 0; }
.auth-switch { color: var(--muted); font-size: 14px; text-align: center; }

/* account + admin */
.page { padding: 32px 0 64px; }
.page h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.meter { height: 8px; border-radius: 4px; background: var(--ink); overflow: hidden; margin: 8px 0; }
.meter > div { height: 100%; background: var(--coral); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.proj { display: flex; flex-direction: column; gap: 6px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.proj-open { display: flex; flex-direction: column; gap: 4px; background: none; border: 0; text-align: start; cursor: pointer; padding: 0; color: var(--text); text-decoration: none; }
.proj img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #2a2e36; border-radius: 8px; }
.proj small { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 28px; letter-spacing: -0.02em; margin-top: 4px; }
.kpi small { color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 48px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; background: var(--ink); border-radius: 5px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--coral); border-radius: 5px; }
.bar-row b { font-family: var(--mono); font-weight: 500; text-align: end; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--soft); }
.badge.pro { background: var(--coral); color: var(--on-coral); }
.badge.admin { background: #1b2b45; color: #9cc2ff; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.funnel div { background: var(--ink); border-radius: 10px; padding: 12px; }
.funnel span { color: var(--muted); font-size: 12px; display: block; }
.funnel b { font-size: 22px; }
.funnel small { color: var(--teal); font-family: var(--mono); }

/* share page / errors */
.share-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.share-wrap { max-width: 1000px; width: 100%; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.share-img { max-height: 75vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.share-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; color: var(--soft); }
.err-page { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; }
.err-page h1 { font-size: 64px; margin: 0; }

/* ad boxes (own ads, AdSense, white preview placeholders) */
.ad-box { position: relative; width: 100%; }
.ad-own { display: block; border-radius: 10px; overflow: hidden; line-height: 0; }
.ad-own img { width: 100%; height: auto; display: block; }
.ad-label { position: absolute; top: 6px; inset-inline-end: 6px; background: rgba(15,17,21,.75); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: .04em; }
.ad-placeholder { background: #ffffff; color: #4B515C; border: 2px dashed #C9CDD4; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 10px; }
.ad-placeholder b { color: #0F1115; font-size: 14px; }
.ad-placeholder span { font-size: 13px; }
.ad-placeholder small { font-size: 11px; color: #6B7280; font-family: var(--mono); }
.ad-editor .ad-placeholder { min-height: 230px; }
.ad-home .ad-placeholder { min-height: 90px; }
.ad-learn .ad-placeholder { min-height: 120px; }
.ad-learn { margin: 24px 0; }
