:root {
  --bg: #070b14;
  --bg-2: #0d1424;
  --panel: #121a2c;
  --line: rgba(255,255,255,.08);
  --text: #e8eefc;
  --muted: rgba(232,238,252,.55);
  --accent: #3dd6c6;
  --accent-2: #4f8cff;
  --danger: #ff6b7a;
  --ok: #5ee4a4;
  --radius: 16px;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(79,140,255,.22), transparent 60%),
    radial-gradient(700px 420px at 90% 0%, rgba(61,214,198,.16), transparent 55%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }
h1,h2,h3 { margin: 0 0 .6rem; letter-spacing: -.02em; }
p { line-height: 1.55; }

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -.03em;
}
.brand span { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); color: #041018; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-sm { padding: .45rem .85rem; font-size: .85rem; }
.btn-danger { background: var(--danger); color: #1a0508; }

.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  color: var(--accent);
  font-weight: 700;
}
.lead { color: var(--muted); font-size: 1.05rem; max-width: 42rem; }

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 5vw;
}
.site-header nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); }
.site-footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.lang-switch { display: inline-flex; gap: .25rem; align-items: center; }
.lang-btn {
  min-width: 2.1rem;
  text-align: center;
  padding: .28rem .45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.lang-btn.active,
.lang-btn:hover {
  color: #041018;
  background: var(--accent);
  border-color: transparent;
}
.auth-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.sidebar .lang-switch { margin: .2rem 0 .4rem; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  padding: 4rem 5vw 2rem;
  align-items: center;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-panel { display: grid; gap: 1rem; }
.panel-card, .card, .stat {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  backdrop-filter: blur(10px);
}
.panel-card span { color: var(--muted); font-size: .85rem; }
.panel-card strong { display: block; margin-top: .35rem; font-size: 1.2rem; }

.section { padding: 3rem 5vw; }
.section.narrow { max-width: 720px; }
.steps, .feature-grid, .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.steps article, .feature-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg-2);
}
.cta-row { margin-top: 1.5rem; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.auth-card {
  width: min(440px, 100%);
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(13,20,36,.9);
}
.auth-card h1 { font-size: 2.4rem; margin-top: 1.2rem; }
.stack { display: grid; gap: .9rem; margin-top: 1.2rem; }
label { display: grid; gap: .35rem; color: var(--muted); font-size: .9rem; }
input, textarea, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a101c;
  color: var(--text);
  padding: .75rem .9rem;
  font: inherit;
}
textarea { resize: vertical; }
.alert {
  margin-top: 1rem;
  padding: .75rem .9rem;
  border-radius: 12px;
  background: rgba(255,107,122,.12);
  border: 1px solid rgba(255,107,122,.35);
  color: #ffd0d5;
}
.alert.ok {
  background: rgba(94,228,164,.12);
  border-color: rgba(94,228,164,.35);
  color: #c9ffe4;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8,12,22,.92);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-user { color: var(--muted); font-size: .85rem; margin: 0; }
.sidebar-nav { display: grid; gap: .35rem; }
.sidebar-nav a {
  color: var(--muted);
  padding: .55rem .7rem;
  border-radius: 10px;
}
.sidebar-nav a.active, .sidebar-nav a:hover {
  background: rgba(61,214,198,.1);
  color: #fff;
}
.sidebar-foot { margin-top: auto; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-top {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.app-top h1 { margin: 0; font-size: 1.25rem; }
.app-content { padding: 1.2rem 1.4rem 2rem; }

.mode-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip {
  padding: .4rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.active { color: #041018; background: var(--accent); border-color: transparent; }

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: calc(100vh - 180px);
}
.chat-pane, .draft-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.vacancy-box { display: grid; gap: .5rem; padding: .8rem; border-bottom: 1px solid var(--line); }
.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: grid;
  gap: .7rem;
  align-content: start;
}
.msg {
  max-width: 92%;
  padding: .7rem .85rem;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: .95rem;
}
.msg.user { margin-left: auto; background: rgba(79,140,255,.18); }
.msg.assistant { background: rgba(255,255,255,.05); }
.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .6rem;
  padding: .8rem;
  border-top: 1px solid var(--line);
}
.draft-toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .7rem;
  border-bottom: 1px solid var(--line);
}
.draft-area {
  flex: 1;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.5;
  min-height: 420px;
}

.jobs-form { display: flex; gap: .8rem; align-items: end; margin-bottom: 1rem; max-width: 720px; }
.jobs-form label { flex: 1; }
.jobs-list { display: grid; gap: .8rem; }
.job-card h3 { margin-bottom: .25rem; }
.job-card p { margin: .2rem 0; color: var(--muted); }
.job-card.is-selected { border-color: rgba(61,214,198,.45); box-shadow: 0 0 0 1px rgba(61,214,198,.25); }
.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
  align-items: center;
}
.job-actions a {
  color: var(--accent);
  font-size: .9rem;
  margin-right: .3rem;
}
.badge-selected {
  display: inline-block;
  margin-left: .4rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: rgba(61,214,198,.18);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
}
.vacancy-active-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.vacancy-pick-label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .9rem;
}
.vacancy-pick-label select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a101c;
  color: var(--text);
  padding: .75rem .9rem;
  font: inherit;
}
.vacancy-empty-hint { margin: 0; font-size: .85rem; }
.vacancy-actions { margin-top: .35rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.row-actions form { display: flex; gap: .35rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.narrow-card { max-width: 480px; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: .8rem; margin-top: 1rem; align-items: center; }
.flash-stack { position: fixed; top: 1rem; right: 1rem; z-index: 50; display: grid; gap: .5rem; }
.flash { background: #152038; border: 1px solid var(--line); padding: .6rem .8rem; border-radius: 10px; }

@media (max-width: 960px) {
  .hero, .workspace, .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ── Motion (same feel as Next/motion) ─────────────────────────── */

.hero { position: relative; overflow: hidden; }
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 720px;
  height: 720px;
  top: -280px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(61, 214, 198, .18);
  animation: glowPulse 8s ease-in-out infinite;
}
.hero::after {
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -80px;
  background: rgba(79, 140, 255, .16);
  animation: glowPulse 10s ease-in-out infinite reverse;
}
.hero > * { position: relative; z-index: 1; }

.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity .8s cubic-bezier(.22, 1, .36, 1),
    transform .8s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}
.reveal.from-right { transform: translateX(64px); }
.reveal.from-left { transform: translateX(-64px); }
.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}
.reveal.delay-1 { transition-delay: .12s; }
.reveal.delay-2 { transition-delay: .24s; }
.reveal.delay-3 { transition-delay: .36s; }
.reveal.delay-4 { transition-delay: .48s; }

.float-y {
  animation: floatY 4.5s ease-in-out infinite;
}
.float-y-alt {
  animation: floatYAlt 5.2s ease-in-out infinite;
}

.auth-shell {
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(79, 140, 255, .12);
  filter: blur(140px);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 9s ease-in-out infinite;
}
.auth-card {
  position: relative;
  z-index: 1;
  animation: fadeUp .7s cubic-bezier(.22, 1, .36, 1) both;
}

.btn {
  transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(61, 214, 198, .22); }
.btn:active { transform: translateY(0); }

.panel-card,
.feature-grid article,
.steps article {
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.panel-card:hover,
.feature-grid article:hover,
.steps article:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 214, 198, .35);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes floatYAlt {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}
@keyframes glowPulse {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .auth-card,
  .float-y,
  .float-y-alt,
  .hero::before,
  .hero::after,
  .auth-shell::before {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
