/* ── Общие переменные ─────────────────────────────────────────────────── */
:root {
  --brand: #4f46e5;
  --brand-light: #ede9fe;
  --success: #16a34a;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
}

/* ── Базовые стили ────────────────────────────────────────────────────── */
body {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  min-height: 100vh;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Навигация ────────────────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 100%) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  padding-top: .75rem;
  padding-bottom: .75rem;
}

.navbar-brand {
  font-size: 1.25rem;
  letter-spacing: -.5px;
}

/* ── Hero иконка ──────────────────────────────────────────────────────── */
.hero-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(79,70,229,.35);
}

.hero-icon .bi {
  font-size: 2.5rem;
  color: #fff;
}

/* ── Карточки ─────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.card-header {
  border-radius: 16px 16px 0 0 !important;
  border-bottom: 1px solid var(--border);
}

/* ── Блок результата генерации ────────────────────────────────────────── */
.result-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
}

.result-box code {
  font-size: .95rem;
  color: #166534;
  word-break: break-all;
}

/* ── Карточки писем в списке ──────────────────────────────────────────── */
.message-card {
  transition: transform .15s ease, box-shadow .15s ease, border-left-color .15s ease;
  border-left: 3px solid transparent !important;
  border-radius: 12px !important;
  cursor: pointer;
}

.message-card:hover {
  transform: translateX(3px);
  border-left-color: var(--brand) !important;
  box-shadow: 0 4px 16px rgba(79,70,229,.12) !important;
}

/* ── Пустой ящик ──────────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 1rem;
}

/* ── Шрифт моноширинный ───────────────────────────────────────────────── */
.font-monospace {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: .88rem;
}

/* ── Кнопки ───────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  border: none;
}

.copy-btn {
  flex-shrink: 0;
  min-width: 38px;
}

/* ── Badge успешный ───────────────────────────────────────────────────── */
.bg-success-subtle {
  background-color: #dcfce7;
}

/* ── iframe письма ────────────────────────────────────────────────────── */
#mailFrame {
  border-radius: 0 0 16px 16px;
}

/* ── Адаптив ──────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .hero-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }
  .hero-icon .bi {
    font-size: 1.8rem;
  }
  h1.h2 {
    font-size: 1.5rem;
  }
}
