@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap");

:root {
  --bg0: #0f1f1a;
  --bg1: #163028;
  --ink: #e8f2ec;
  --muted: #9bb5a8;
  --accent: #d4a24c;
  --accent-2: #2f6f57;
  --danger: #c45c4a;
  --line: rgba(232, 242, 236, 0.12);
  --glow: rgba(212, 162, 76, 0.25);
  --font-display: "Cairo", sans-serif;
  --font-body: "IBM Plex Sans Arabic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(47, 111, 87, 0.45), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(212, 162, 76, 0.18), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 55%, #0c1814);
}

body {
  direction: rtl;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 1.25rem;
  padding: 3rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -20% 10% auto;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(232, 242, 236, 0.16), transparent 42%),
    radial-gradient(circle at 60% 60%, rgba(47, 111, 87, 0.55), transparent 60%),
    linear-gradient(145deg, #245844, #0f241c);
  filter: blur(2px);
  animation: drift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-18px, 24px, 0) scale(1.05);
  }
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  position: relative;
  animation: rise 0.8s ease both;
}

.lead {
  max-width: 34rem;
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  position: relative;
  animation: rise 0.9s ease 0.08s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  position: relative;
  animation: rise 1s ease 0.16s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #1a1408;
  box-shadow: 0 10px 30px var(--glow);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.5rem;
}

.section p {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 36rem;
}

.steps {
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

.steps li {
  list-style: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}

.chat-layout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0 1rem;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
}

.messages {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
}

.bubble {
  max-width: 85%;
  padding: 0.85rem 1rem;
  border-radius: 1.1rem;
  white-space: pre-wrap;
  line-height: 1.6;
  animation: rise 0.35s ease both;
}

.bubble.user {
  align-self: flex-start;
  background: rgba(232, 242, 236, 0.1);
  border: 1px solid var(--line);
}

.bubble.bot {
  align-self: flex-end;
  background: linear-gradient(160deg, #2a5d49, #1d4336);
  border: 1px solid rgba(212, 162, 76, 0.25);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--line);
}

.composer input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  font: inherit;
}

.composer input:focus,
.field input:focus,
.field select:focus {
  outline: 2px solid rgba(212, 162, 76, 0.45);
  border-color: transparent;
}

.admin-grid {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem 0 2rem;
}

.panel {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: right;
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(47, 111, 87, 0.45);
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-actions button {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.token-bar {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.status-pill {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--glow);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  50% {
    transform: scale(0.85);
    opacity: 0.7;
  }
}

@media (max-width: 640px) {
  .token-bar {
    grid-template-columns: 1fr;
  }
}

.login-panel {
  max-width: 420px;
  margin: 4rem auto;
  padding: 1.5rem 0;
}

.login-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.login-form .field {
  display: grid;
  gap: 0.35rem;
}

.login-form .btn {
  width: 100%;
  margin-top: 0.25rem;
}
