/* assyai.ru — фиолетовая тема сервиса конспектов */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --violet-50: #f6f4ff;
  --violet-100: #ece7ff;
  --violet-200: #d9d0ff;
  --violet-300: #bfaeff;
  --violet-400: #a385ff;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-900: #3b1670;
  --pink-500: #d946ef;
  --ink: #241b3a;
  --ink-soft: #6b628a;
  --line: #e7e1fb;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fde8e8;
  --success: #16a34a;
  --success-bg: #e5fbee;
  --grad-brand: linear-gradient(135deg, var(--violet-600) 0%, var(--violet-500) 45%, var(--pink-500) 100%);
  --grad-bg: radial-gradient(circle at 10% -10%, #efe8ff 0%, transparent 45%),
             radial-gradient(circle at 100% 0%, #fbe8ff 0%, transparent 40%),
             linear-gradient(180deg, #faf9ff 0%, #f3f0ff 100%);
  --shadow-sm: 0 2px 8px rgba(109, 40, 217, 0.08);
  --shadow-md: 0 10px 30px rgba(109, 40, 217, 0.14);
  --shadow-btn: 0 8px 20px rgba(139, 92, 246, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--grad-bg);
  background-attachment: fixed;
  color: var(--ink);
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  line-height: 1.5;
  min-height: 100vh;
}

body.auth-body {
  max-width: 420px;
  padding-top: 8vh;
}

h1, h2 {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; margin-top: 36px; margin-bottom: 14px; color: var(--violet-700); }

a { color: var(--violet-600); text-decoration: none; font-weight: 600; }
a:hover { color: var(--violet-700); text-decoration: underline; }

p { color: var(--ink-soft); }

/* ---------- header / top bar ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.brand-badge {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}

.top .user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--violet-50);
  border: 1px solid var(--violet-200);
  color: var(--violet-700);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--violet-700);
  background: transparent;
  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.top nav a:hover { background: var(--violet-100); text-decoration: none; transform: translateY(-1px); }
.top nav a.active { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-btn); }
.top nav a.active:hover { color: #fff; transform: none; }
.top nav .danger { color: var(--danger); }
.top nav .danger:hover { background: var(--danger-bg); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  animation: rise .35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- buttons ---------- */
button, .btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  color: #fff;
  background: var(--grad-brand);
  background-size: 160% 160%;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow-btn);
  transition: transform .15s ease, box-shadow .15s ease, background-position .4s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(139, 92, 246, 0.45);
  background-position: 100% 0;
}
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: var(--violet-50);
  color: var(--violet-700);
  box-shadow: none;
  border: 1px solid var(--violet-200);
}
.btn-ghost:hover { background: var(--violet-100); box-shadow: none; }

.btn-danger { color: var(--danger); border-color: var(--danger-bg); }
.btn-danger:hover { background: var(--danger-bg); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.upload-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.upload-progress { display: none; margin-top: 16px; max-width: 360px; }
.upload-progress.active { display: block; }
.upload-progress-track {
  background: var(--violet-100);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-brand);
  width: 0%;
  transition: width .2s ease;
}
.upload-progress-row { display: flex; justify-content: flex-end; margin-top: 6px; }
.upload-progress-text { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }

/* ---------- forms ---------- */
label { font-weight: 600; font-size: 0.9rem; color: var(--ink); display: block; margin-bottom: 6px; }

input[type=text], input[type=password], input[type=file], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: #fdfcff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus {
  outline: none;
  border-color: var(--violet-400);
  box-shadow: 0 0 0 4px var(--violet-100);
}

input[type=file] {
  cursor: pointer;
  padding: 10px;
}
input[type=file]::file-selector-button {
  font-family: inherit;
  font-weight: 700;
  border: none;
  color: #fff;
  background: var(--grad-brand);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  margin-right: 12px;
}

.field-row { margin-bottom: 16px; }

.radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.radio-group label {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, background .15s ease;
}
.radio-group label:hover { border-color: var(--violet-300); background: var(--violet-50); }
.radio-group input { accent-color: var(--violet-600); width: 16px; height: 16px; }

fieldset {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 20px;
}
legend { font-weight: 700; color: var(--violet-700); padding: 0 8px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 6px; }
th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--violet-50); }

/* ---------- status pills ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--violet-100);
  color: var(--violet-700);
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-done { background: var(--success-bg); color: var(--success); }
.status-error { background: var(--danger-bg); color: var(--danger); }
.status-new, .status-audio_extracting, .status-transcribing,
.status-transcribed, .status-summarizing, .status-rendering {
  background: var(--violet-100); color: var(--violet-700);
}

/* result text feedback under upload form */
#uploadResult { display: block; margin-top: 12px; font-size: 0.88rem; color: var(--ink-soft); font-weight: 600; min-height: 1.2em; }

/* ---------- budget page ---------- */
.warn { color: var(--danger); font-weight: 700; }
.bar { background: var(--violet-100); border-radius: 999px; height: 14px; overflow: hidden; margin: 14px 0 6px; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-brand);
  transition: width .4s ease;
}
.bar-fill.warn-fill { background: linear-gradient(135deg, #f97316, #ef4444); }

/* ---------- login page ---------- */
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.auth-card h1 { text-align: center; margin-bottom: 4px; }
.auth-card p.subtitle { text-align: center; margin-bottom: 24px; font-size: 0.9rem; }
.auth-card form { text-align: left; }
.auth-card button { width: 100%; justify-content: center; margin-top: 6px; }
.error-box {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: left;
}

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 30px 10px; color: var(--ink-soft); }
.helper-text { color: var(--ink-soft); font-size: 0.85rem; }

@media (max-width: 640px) {
  body { padding: 20px 14px 48px; }
  .card { padding: 18px; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tbody tr {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px 4px;
  }
  td { border-bottom: none; padding: 8px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  td::before { content: attr(data-label); font-weight: 700; color: var(--ink-soft); text-align: left; }
}

/* ---------- переключатель типа файла (видео/аудио) ---------- */
.type-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.type-toggle .type-btn {
  flex: 1;
  justify-content: center;
  background: var(--violet-50);
  color: var(--violet-700);
  box-shadow: none;
  border: 1.5px solid var(--line);
  padding: 10px 16px;
}
.type-toggle .type-btn:hover { background: var(--violet-100); box-shadow: none; transform: none; }
.type-toggle .type-btn.active {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-btn);
}

/* ---------- job detail page ---------- */
.job-file-link { color: var(--violet-700); font-weight: 600; text-decoration: none; }
.job-file-link:hover { text-decoration: underline; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}
.stat-item {
  background: var(--violet-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  font-weight: 700;
}
.stat-value { font-size: 1.05rem; font-weight: 600; color: var(--ink); }

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
  .stat-item { padding: 10px 12px; }
  .stat-value { font-size: 0.95rem; }
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-awaiting_recording { background: var(--violet-100); color: var(--violet-700); }
