/* DNAcrypt-AI — Main stylesheet */

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --border:      #30363d;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --accent:      #238636;
  --accent-hover:#2ea043;
  --danger:      #da3633;
  --info:        #388bfd;
  --radius:      8px;
  --font:        'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { background: #21262d; border-color: #8b949e; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-lg { padding: .75rem 1.6rem; font-size: 1rem; }
.btn-sm { padding: .25rem .7rem; font-size: .8rem; }
.btn-block { width: 100%; }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.alert-error   { background: #3d1f1f; border-color: var(--danger); color: #ff9092; }
.alert-success { background: #1a3626; border-color: var(--accent); color: #56d364; }

/* ── Landing ────────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.navbar nav { display: flex; gap: 1rem; align-items: center; }

.hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.2; margin-bottom: 1.2rem; }
.hero .lead { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }
.hero a { margin: 0 .4rem; }

.features {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 260px;
  text-align: center;
}
.feature .icon { font-size: 2rem; display: block; margin-bottom: .75rem; }
.feature h3 { margin-bottom: .5rem; }
.feature p { color: var(--muted); font-size: .9rem; }

footer { text-align: center; padding: 2rem; color: var(--muted); border-top: 1px solid var(--border); }

/* ── Auth ───────────────────────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}
.brand-center { display: block; text-align: center; margin-bottom: 1.5rem; }
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; }
.auth-footer { text-align: center; margin-top: 1rem; color: var(--muted); font-size: .9rem; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
label { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }
label input, label textarea, label select {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .5rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}
label input:focus, label textarea:focus { border-color: var(--info); }
label textarea { resize: vertical; }
label.radio { display: flex; align-items: center; gap: .5rem; color: var(--text); margin-bottom: .4rem; }
label.radio input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
legend { padding: 0 .4rem; font-size: .85rem; color: var(--muted); }

/* ── App layout ─────────────────────────────────────────────────────────────── */
.app-page {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 1rem;
}
.sidebar-brand { display: block; margin-bottom: .5rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar-nav a {
  padding: .5rem .75rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: #21262d;
  color: var(--text);
  text-decoration: none;
}
.sidebar-user { font-size: .85rem; color: var(--muted); padding: .5rem; border-top: 1px solid var(--border); }

.app-main { padding: 2rem; max-width: 860px; }
.app-main h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.1rem; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* ── Status / result ────────────────────────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  font-weight: 600;
}
.uid-badge {
  font-size: .75rem;
  font-family: monospace;
  color: var(--muted);
  background: var(--bg);
  padding: .2rem .5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: monospace;
  font-size: .85rem;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* ── Jobs table ─────────────────────────────────────────────────────────────── */
.jobs-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.jobs-table th, .jobs-table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); }
.jobs-table th { color: var(--muted); font-weight: 500; }

.badge { padding: .2rem .55rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-queued  { background: #2d2d2d; color: var(--muted); }
.badge-running { background: #1f3a5f; color: #79c0ff; }
.badge-done    { background: #1a3626; color: #56d364; }
.badge-error   { background: #3d1f1f; color: #ff9092; }

/* ── Utils ──────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted  { color: var(--muted); }

/* ── Secret panel ────────────────────────────────────────────────────────────── */
.secret-panel {
  background: #0d2b1a;
  border: 2px solid #238636;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}
.secret-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  font-weight: 600;
}
.secret-warning {
  font-size: .8rem;
  color: #f0883e;
  font-weight: 500;
}
.secret-value {
  font-family: 'Courier New', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #56d364;
  background: #051a0d;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #238636;
  word-break: break-all;
  margin-bottom: .5rem;
  user-select: all;
}
.secret-meta {
  font-size: .82rem;
  color: var(--muted);
}

/* ── Progress bar ────────────────────────────────────────────────────────────── */
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: .5rem 0 1rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #238636, #56d364);
  border-radius: 3px;
  transition: width .4s ease;
  min-width: 0;
}
