/* Tarabot Connect — theme matched to tarabot.info's design tokens. */
:root {
  --background: #f8fafb;
  --foreground: #0d1b2a;
  --surface: #ffffff;
  --surface-alt: #f0f5f9;
  --border: #dce6ef;
  --muted: #5a7184;
  --primary: #0f3d5c;
  --primary-hover: #0a2e47;
  --primary-foreground: #ffffff;
  --accent: #0ea5c8;
  --accent-hover: #0891b2;
  --accent-foreground: #ffffff;
  --ring: rgba(14, 165, 200, 0.3);
  --shadow-card: 0 2px 16px 0 rgba(15, 61, 92, 0.07);
  --radius: 0.5rem;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #10b981;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #080f17;
    --foreground: #e8f1f8;
    --surface: #0d1a26;
    --surface-alt: #101e2d;
    --border: rgba(100, 140, 170, 0.2);
    --muted: #94afc5;
    --accent-hover: #38bdf8;
    --accent-foreground: #080f17;
    --ring: rgba(14, 165, 200, 0.45);
    --shadow-card: 0 2px 20px 0 rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --background: #080f17;
  --foreground: #e8f1f8;
  --surface: #0d1a26;
  --surface-alt: #101e2d;
  --border: rgba(100, 140, 170, 0.2);
  --muted: #94afc5;
  --accent-hover: #38bdf8;
  --accent-foreground: #080f17;
  --ring: rgba(14, 165, 200, 0.45);
  --shadow-card: 0 2px 20px 0 rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --background: #f8fafb;
  --foreground: #0d1b2a;
  --surface: #ffffff;
  --surface-alt: #f0f5f9;
  --border: #dce6ef;
  --muted: #5a7184;
  --accent-hover: #0891b2;
  --accent-foreground: #ffffff;
  --ring: rgba(14, 165, 200, 0.3);
  --shadow-card: 0 2px 16px 0 rgba(15, 61, 92, 0.07);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Tajawal', 'Inter', -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  transition: background-color 0.15s ease, color 0.15s ease;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--foreground); }
.brand .logo { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; display: block; }
.brand .wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand .wordmark span { color: var(--accent); }

nav.tabs { display: flex; gap: 2px; }
nav.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background-color 0.12s ease, color 0.12s ease;
}
nav.tabs a i { font-size: 12px; width: 14px; text-align: center; }
nav.tabs a.active { background: var(--primary); color: var(--primary-foreground); }
nav.tabs a:hover:not(.active) { background: var(--surface-alt); color: var(--foreground); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}
.theme-toggle:hover { color: var(--foreground); }

main { max-width: 920px; margin: 0 auto; padding: 36px 24px 60px; }
h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: -0.01em; }
h1 i { color: var(--accent); margin-right: 8px; font-size: 20px; }
p.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 28px; font-size: 14.5px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; }
.card h3 i { color: var(--accent); margin-right: 8px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.field label {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.field .value { font-size: 14.5px; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; word-break: break-all; }

input, textarea, select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
textarea { min-height: 90px; resize: vertical; }

button {
  background: var(--accent);
  color: var(--accent-foreground);
  border: none;
  border-radius: var(--radius);
  padding: 11px 20px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.12s ease, filter 0.12s ease;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.secondary { background: var(--surface-alt); color: var(--foreground); border: 1px solid var(--border); }
button.secondary:hover { background: var(--border); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: rgba(16, 185, 129, 0.12); color: var(--ok); }
.badge.warn { background: rgba(245, 158, 11, 0.12); color: var(--warn); }
.badge.err { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

pre.result {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: calc(var(--radius) * 1.6);
  padding: 22px 26px;
  margin-bottom: 24px;
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-card);
}
.hero .hero-text .eyebrow { font-size: 12px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.hero .hero-text h1 { color: #fff; margin-bottom: 2px; }
.hero .hero-text h1 i { color: var(--accent); }
.hero .hero-text p { color: rgba(255,255,255,0.75); margin: 0; font-size: 13.5px; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 24px; }
footer a { color: var(--muted); }

.hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.hint i { margin-top: 2px; color: var(--warn); }

a.inline-link { color: var(--accent); text-decoration: none; }
a.inline-link:hover { text-decoration: underline; }
