:root {
  --bg: #0f1216;
  --panel: #171c22;
  --panel-2: #1e252d;
  --line: #2a333d;
  --text: #eef2f6;
  --muted: #9aa7b4;
  --brand: #c8862b;
  --brand-2: #e0a94a;
  --danger: #d9534f;
  --radius: 14px;
  /* Consult font system - Arabic default swaps in below */
  --font-body: "Manrope", "Tajawal", system-ui, sans-serif;
  --font-head: "Fraunces", "Manrope", Georgia, serif;
}

/* Arabic typography when the interface is in Arabic */
html[lang="ar"] {
  --font-body: "Tajawal", system-ui, sans-serif;
  --font-head: "Aref Ruqaa Ink", "Tajawal", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(1200px 600px at 80% -10%, #1c2530 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font-family: inherit; }
h1, h2 { font-family: var(--font-head); }

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 18, 22, 0.7);
  backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #8a5d1c);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-text { font-size: 1.05rem; }

.topnav { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-weight: 500; }
.navlink { color: var(--muted); font-weight: 700; }
.navlink:hover { color: var(--text); }
.inline { display: inline; margin: 0; }

.page { flex: 1; width: min(1040px, 92vw); margin: 0 auto; padding: 32px 0 48px; }

.hero { margin-bottom: 24px; }
.hero h1 { margin: 0 0 6px; font-size: 1.8rem; }
.muted { color: var(--muted); margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tool-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0.35); transform-origin: left center;
  transition: transform 0.28s ease;
}
[dir="rtl"] .tool-card::before { transform-origin: right center; }
.tool-card:hover {
  transform: translateY(-4px); border-color: var(--brand);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}
.tool-card:hover::before { transform: scaleX(1); }
.tool-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--brand);
  font-weight: 800;
  font-size: 0.85rem;
}
.tool-card h2 { margin: 6px 0 0; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tool-open { margin-top: auto; color: var(--brand); font-weight: 700; font-size: 0.9rem; }

.auth { display: grid; place-items: center; padding-top: 6vh; }
.auth-card {
  width: min(400px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.auth-card h1 { margin: 0 0 4px; }

.stack { display: grid; gap: 14px; margin-top: 18px; }
.stack label { display: grid; gap: 6px; font-weight: 500; }

input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
input:focus { outline: 2px solid var(--brand); border-color: transparent; }

.btn {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  transition: filter 0.12s ease, background 0.12s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.flashes { width: min(1040px, 92vw); margin: 16px auto 0; }
.flash {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #2a2015;
  border: 1px solid #6b4e1f;
  color: #f3d9a6;
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0.35); transform-origin: left center;
  transition: transform 0.28s ease;
}
[dir="rtl"] .panel::before { transform-origin: right center; }
.panel:hover::before { transform: scaleX(1); }
.panel h2 { margin: 0 0 14px; font-size: 1.15rem; }

.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-form input[type="text"], .row-form input[name] { width: auto; flex: 1 1 180px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.check input { width: auto; }

.users { width: 100%; border-collapse: collapse; }
.users th, .users td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.users th { color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions input { width: 150px; }

.foot { border-top: 1px solid var(--line); padding: 16px 24px; color: var(--muted); font-size: 0.85rem; }
.foot p { margin: 0; }

/* --- CraftOffice storefront + account additions --- */
.hero-lg { padding: 18px 0 8px; }
.hero-lg h1 { font-size: 2.1rem; max-width: 22ch; }
.hero-lg .muted { max-width: 60ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hero h2 { margin: 8px 0 0; font-size: 1.25rem; }

.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg-btn { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.seg-btn.on { background: var(--brand); color: #fff; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on:hover { color: #fff; }

.price { color: var(--brand-2); font-weight: 800; }
.price-lg { font-size: 1.5rem; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.pay-badge { font-size: 0.72rem; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

.small { font-size: 0.82rem; }
textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-family: inherit; font-size: 0.95rem; resize: vertical; }
textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-family: inherit; font-size: 0.95rem; }

.paychoice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.paychoice legend { padding: 0 6px; color: var(--muted); font-weight: 700; }
.radio { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 500; }
.radio input { width: auto; }

.summary { display: grid; gap: 8px; margin: 18px 0; }
.summary > div { display: flex; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.summary span { color: var(--muted); }
.auth-card .btn { margin-top: 8px; margin-right: 8px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.pill-paid { background: #143020; border: 1px solid #2f7d4f; color: #8fe3ab; }
.pill-pending { background: #2a2015; border: 1px solid #6b4e1f; color: #f3d9a6; }
.pill-cancelled, .pill-failed { background: #2a1717; border: 1px solid #6b2020; color: #f3a6a6; }

.pos { color: #8fe3ab; }
.neg { color: #f3a6a6; }
.svc-row { margin-bottom: 6px; }
.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.row-form label { color: var(--muted); font-size: 0.85rem; display: inline-flex; flex-direction: column; gap: 4px; }
