/* Hoshana Web — shared design system (RTL, dark-first, responsive) */
:root {
  --bg: #0d1220;
  --bg2: #131a2e;
  --card: #18203a;
  --line: #26304e;
  --text: #e9ecf5;
  --muted: #8d96ad;
  --accent: #7da2ff;
  --accent2: #9db9ff;
  --grad: linear-gradient(135deg, #5b7fe8, #7da2ff);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
}
[dir="ltr"] { direction: ltr; }
a { color: var(--accent2); text-decoration: none; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11,13,18,.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); display: grid; place-items: center;
  font-size: 1.1rem; color: #fff;
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav-links a.hide-m { display: none; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 22px; border-radius: 12px; border: none; cursor: pointer;
  font-family: inherit; font-size: .95rem; font-weight: 600;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 22px rgba(108,123,255,.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: #ef444433; color: #f87171; border: 1px solid #ef444455; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* hero */
.hero { text-align: center; padding: 90px 0 60px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 20% auto; height: 480px;
  background: radial-gradient(closest-side, rgba(108,123,255,.22), transparent);
  pointer-events: none;
}
.hero h1 { font-size: clamp(1.9rem, 5vw, 3.3rem); font-weight: 900; line-height: 1.35; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { color: var(--muted); max-width: 640px; margin: 18px auto 32px; font-size: clamp(.95rem, 2vw, 1.1rem); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* sections & cards */
.section { padding: 60px 0; }
.section-title { text-align: center; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 42px; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: #35405c; }
.card .icon { font-size: 1.7rem; margin-bottom: 12px; }
.card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .92rem; }

/* pricing */
.price-card { text-align: center; position: relative; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 10px 40px rgba(108,123,255,.18); }
.badge {
  position: absolute; top: -13px; right: 50%; transform: translateX(50%);
  background: var(--grad); color: #fff; font-size: .75rem; padding: 4px 14px; border-radius: 999px;
}
.price { font-size: 2rem; font-weight: 900; margin: 12px 0 4px; }
.price small { font-size: .85rem; color: var(--muted); font-weight: 400; }
.price-card ul { list-style: none; margin: 18px 0; text-align: right; }
.price-card li { padding: 7px 0; color: var(--muted); font-size: .92rem; border-bottom: 1px dashed var(--line); }
.price-card li:last-child { border-bottom: none; }
.price-card li.ok::before { content: "✓ "; color: var(--accent2); font-weight: 700; }
.price-card li.no::before { content: "✗ "; color: #ef4444; }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .87rem; color: var(--muted); margin-bottom: 7px; }
.input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: .95rem; outline: none; transition: border-color .2s;
}
.input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }

.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; color: #1f2937; padding: 13px; border-radius: 12px;
  font-weight: 600; font-family: inherit; font-size: 1rem; border: none; cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.google-btn:hover { opacity: .92; transform: translateY(-1px); }

/* chat app */
.app-shell { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }
.menu-btn { display: none; }
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 1.2rem; cursor: pointer; }
  .sidebar {
    position: fixed; inset-block: 0; right: 0; width: min(78vw, 300px); z-index: 50;
    transform: translateX(100%); transition: transform .25s ease; box-shadow: -12px 0 40px rgba(0,0,0,.5);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .chat-head { padding: 10px 14px; }
  .chat-log { padding: 14px; }
  .chat-input { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .msg { max-width: 92% !important; font-size: .93rem; }
}
.sidebar {
  background: var(--bg2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 8px;
}
.sidebar .user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--card); margin-bottom: 10px; }
.user-chip img { width: 36px; height: 36px; border-radius: 50%; }
.user-chip .nm { font-size: .88rem; font-weight: 700; }
.user-chip .em { font-size: .72rem; color: var(--muted); direction: ltr; text-align: left; }
.plan-pill { font-size: .68rem; background: var(--grad); padding: 2px 9px; border-radius: 999px; margin-inline-start: auto; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: .92rem; cursor: pointer; transition: all .15s; border: none; background: none; font-family: inherit; text-align: right; width: 100%;
}
.side-link:hover, .side-link.active { background: var(--card); color: var(--text); }
.chat-pane { display: flex; flex-direction: column; height: 100vh; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(11,13,18,.7); }
.chat-log { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: min(720px, 86%); padding: 13px 17px; border-radius: 16px; font-size: .95rem; line-height: 1.9; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.msg.user { align-self: flex-end; background: var(--accent); color: #0d1220; border-bottom-left-radius: 5px; font-weight: 500; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-right-radius: 5px; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-input {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 22px; border-top: 1px solid var(--line);
}
.chat-input .composer {
  flex: 1; display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px;
  padding: 6px 6px 6px 14px; transition: border-color .2s, box-shadow .2s;
}
.chat-input .composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125,162,255,.15); }
.chat-input .composer textarea {
  border: none; background: none; padding: 10px 0; min-height: 24px; max-height: 160px;
  resize: none; font-family: inherit; font-size: .95rem; color: var(--text); width: 100%; outline: none;
}
.chat-input .composer .send-btn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; border: none;
  background: var(--accent); color: #0d1220; font-size: 1.05rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: opacity .15s, transform .1s;
}
.attach-btn {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; border: none;
  background: none; cursor: pointer; font-size: 1rem; opacity: .7;
}
.attach-btn:hover { opacity: 1; background: var(--card); }
.chat-input .composer { padding-left: 6px; }
.msg-actions { margin-top: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-family: inherit; font-size: .72rem; padding: 2px 10px; border-radius: 8px; cursor: pointer;
}
.msg-actions button:hover { color: var(--text); border-color: var(--accent); }
.edit-box {
  width: 100%; background: var(--bg2); border: 1px solid var(--accent); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: .93rem; padding: 10px 12px;
  outline: none; resize: vertical; margin-bottom: 8px; direction: rtl;
}
.edit-btns { display: flex; gap: 8px; margin-top: 4px; }
.btn-plain-sm {
  background: var(--accent); color: #0d1220; border: none; border-radius: 9px;
  padding: 6px 16px; font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.btn-plain-sm.ghost { background: none; border: 1px solid var(--line); color: var(--muted); }
/* light theme */
body.light { --bg:#f7f8fc; --bg2:#eef1f8; --card:#ffffff; --line:#dfe4f0; --text:#1a2238; --muted:#5c6683; --accent:#3b63d8; --accent2:#2f55c0; }
body.light .chat-head { background: rgba(247,248,252,.85); }
/* entrance animations */
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg { animation: msgIn .28s cubic-bezier(.21,1.02,.73,1); }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } * { transition-duration: 0s !important; } }
.chat-input .composer .send-btn:hover { opacity: .9; }
.chat-input .composer .send-btn:disabled { opacity: .45; cursor: default; }
.msg.typing span { display: inline-block; width: 7px; height: 7px; background: var(--muted); border-radius: 50%; margin: 0 2px; animation: blink 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .2s; } .msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity:.25 } 40% { opacity: 1 } }
.chat-input { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; min-height: 48px; max-height: 140px; }

/* tables (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
th, td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: var(--bg2); }
tr:last-child td { border-bottom: none; }
td.ltr { direction: ltr; text-align: left; }

/* misc */
.stat-num { font-size: 1.7rem; font-weight: 900; }
.stat-label { color: var(--muted); font-size: .83rem; }
.footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); font-size: .85rem; text-align: center; margin-top: 40px; }
.toast {
  position: fixed; bottom: 24px; right: 50%; transform: translateX(50%); z-index: 99;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 12px 22px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; font-size: .9rem;
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(-6px); }
.hidden { display: none !important; }
.auth-card { max-width: 420px; margin: 8vh auto; }
.center { text-align: center; }
.mono { font-family: ui-monospace, monospace; direction: ltr; unicode-bidi: embed; }

.brand .logo-img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }
