/* ============================================================
   uniq.down-web.ru – styles.css  v20260310a
   ============================================================ */

/* Added service facts use the existing visual system and remain readable in both themes. */
.seo-extension .seo-steps {
  margin: 0;
  padding-left: 1.25rem;
}

.seo-extension .seo-steps li {
  padding-left: 0.2rem;
}

[data-bs-theme="dark"] .seo-extension article {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-bs-theme="dark"] .seo-extension h2,
[data-bs-theme="dark"] .seo-extension h3 {
  color: #58a6ff !important;
}

[data-bs-theme="dark"] .seo-extension p,
[data-bs-theme="dark"] .seo-extension li {
  color: #8b949e !important;
}

/* ── CSS Custom Properties (Light Theme) ─────────────────── */
:root {
  --brand-blue: #4a90e2;
  --brand-blue-dark: #2f6cb3;
  --brand-green: #4caf50;
  --brand-green-dark: #3f9643;
  --bg: #eef4fb;
  --text: #1f2937;
  --muted: #64748b;
  --card: #ffffff;
  --border: #dbe6f3;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

/* ── Dark Theme Variables ─────────────────────────────────── */
[data-bs-theme="dark"] {
  --bg: #0d1117;
  --text: #c9d1d9;
  --muted: #8b949e;
  --card: #161b22;
  --border: #30363d;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  --brand-blue: #58a6ff;
  --brand-blue-dark: #1f6feb;
  --brand-green: #3fb950;
  --brand-green-dark: #2ea043;
}

[data-bs-theme="dark"] body {
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(31, 111, 235, 0.08), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(63, 185, 80, 0.06), transparent 58%),
    #0d1117;
  color: var(--text);
}

[data-bs-theme="dark"] .site-header {
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.96), rgba(13, 17, 23, 0.92));
  border-bottom-color: rgba(48, 54, 61, 0.8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .main-menu {
  background: rgba(22, 27, 34, 0.9);
  border-top-color: rgba(48, 54, 61, 0.5);
  border-bottom-color: rgba(48, 54, 61, 0.5);
}

[data-bs-theme="dark"] .main-menu .nav-link {
  color: #8b949e;
  border-color: rgba(48, 54, 61, 0.6);
  background: rgba(33, 38, 45, 0.8);
}

[data-bs-theme="dark"] .main-menu .nav-link:hover {
  background: rgba(48, 54, 61, 0.9);
  border-color: rgba(88, 166, 255, 0.4);
  color: #58a6ff;
}

[data-bs-theme="dark"] .form-container {
  background: #161b22;
  border-color: #30363d;
}

[data-bs-theme="dark"] .form-container > header h2 {
  color: #58a6ff;
}

[data-bs-theme="dark"] .form-group label,
[data-bs-theme="dark"] .mb-3 label {
  color: #c9d1d9;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] #customFile,
[data-bs-theme="dark"] #copies,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] input[type='number'],
[data-bs-theme="dark"] input[type='file'] {
  background: #0d1117;
  border-color: #30363d;
  color: #c9d1d9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] #copies:focus,
[data-bs-theme="dark"] textarea:focus,
[data-bs-theme="dark"] select:focus,
[data-bs-theme="dark"] input:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

[data-bs-theme="dark"] .auth-inline-link,
[data-bs-theme="dark"] .error-inline-link {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  color: #58a6ff;
}

[data-bs-theme="dark"] .countdown__label {
  color: #58a6ff;
}

[data-bs-theme="dark"] .countdown__time {
  color: #e6edf3;
}

[data-bs-theme="dark"] .countdown__hint {
  color: #8b949e;
}

[data-bs-theme="dark"] .countdown__bg {
  stroke: #21262d;
}

[data-bs-theme="dark"] #resultPanel,
[data-bs-theme="dark"] #feedbackContainer,
[data-bs-theme="dark"] .alert,
[data-bs-theme="dark"] .table-responsive,
[data-bs-theme="dark"] section.info,
[data-bs-theme="dark"] section.technologies,
[data-bs-theme="dark"] section.usage-tips,
[data-bs-theme="dark"] section.faq {
  background: #161b22;
  border-color: #30363d;
}

[data-bs-theme="dark"] #resultPanel h3,
[data-bs-theme="dark"] #feedbackContainer h3,
[data-bs-theme="dark"] .info h2,
[data-bs-theme="dark"] .technologies h3,
[data-bs-theme="dark"] .usage-tips h3,
[data-bs-theme="dark"] .faq h2 {
  color: #58a6ff !important;
}

[data-bs-theme="dark"] .info p,
[data-bs-theme="dark"] .technologies p,
[data-bs-theme="dark"] .usage-tips p,
[data-bs-theme="dark"] .faq p,
[data-bs-theme="dark"] .info li {
  color: #8b949e !important;
}

[data-bs-theme="dark"] .table {
  color: #c9d1d9;
}

[data-bs-theme="dark"] .table thead th {
  background: #21262d;
  border-bottom-color: #30363d;
  color: #58a6ff;
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light th {
  background: #21262d;
  color: #8b949e;
}

[data-bs-theme="dark"] footer {
  background: #010409;
  border-top-color: #21262d;
}

[data-bs-theme="dark"] footer p {
  color: #8b949e;
}

[data-bs-theme="dark"] .banner_head img,
[data-bs-theme="dark"] .banner_head video,
[data-bs-theme="dark"] .banner_head .banner_img {
  border-color: #30363d;
}

/* Tailwind class overrides for dark mode */
[data-bs-theme="dark"] .text-gray-700 {
  color: #8b949e !important;
}

[data-bs-theme="dark"] .text-gray-600 {
  color: #6e7681 !important;
}

[data-bs-theme="dark"] .text-blue-600,
[data-bs-theme="dark"] .text-blue-500 {
  color: #58a6ff !important;
}

[data-bs-theme="dark"] .bg-blue-50 {
  background-color: #0d2044 !important;
}

[data-bs-theme="dark"] .bg-white {
  background-color: #161b22 !important;
}

[data-bs-theme="dark"] .border-gray-200 {
  border-color: #30363d !important;
}

[data-bs-theme="dark"] .text-gray-900 {
  color: #e6edf3 !important;
}

[data-bs-theme="dark"] .text-gray-500 {
  color: #6e7681 !important;
}

[data-bs-theme="dark"] .alert-info {
  background-color: #0d2044;
  border-color: #1f6feb;
  color: #58a6ff;
}

[data-bs-theme="dark"] .logo .logo-link {
  color: #58a6ff;
}

[data-bs-theme="dark"] .logo small,
[data-bs-theme="dark"] .logo .text-muted {
  color: #8b949e !important;
}

[data-bs-theme="dark"] .copy-addr {
  color: #58a6ff;
}

[data-bs-theme="dark"] .copy-addr:hover {
  color: #79c0ff;
}

[data-bs-theme="dark"] .telegram-icon {
  background: linear-gradient(180deg, rgba(33, 38, 45, 0.95), rgba(22, 27, 34, 0.9));
  border-color: rgba(48, 54, 61, 0.8);
}

[data-bs-theme="dark"] .form-text {
  color: #6e7681;
}

[data-bs-theme="dark"] .form-check-label {
  color: #c9d1d9;
}

/* ── Base Styles ─────────────────────────────────────────── */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Manrope', 'Roboto', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(74, 144, 226, 0.16), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(76, 175, 80, 0.12), transparent 58%),
    var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.container {
  max-width: 1120px;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.86));
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.top-header {
  padding: 12px 0;
}

.top-header .container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 12px;
  align-items: center;
}

.logo {
  min-width: 0;
}

.logo .logo-link {
  text-decoration: none;
  color: #1e3a5f;
  font-weight: 800;
  font-size: clamp(1.2rem, 1.4vw, 1.45rem);
  letter-spacing: 0.02em;
}

.logo small,
.logo .text-muted {
  color: #64748b !important;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-title {
  text-align: center;
}

.site-title h1,
h1 {
  margin: 0;
  color: #1f5fa7;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: clamp(1.08rem, 1.9vw, 1.55rem);
  text-wrap: balance;
  text-shadow: none;
}

/* ── Language Flags ───────────────────────────────────────── */
.language-flag {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.language-flag a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 2px;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-flag a:hover {
  transform: translateY(-1px);
}

.language-flag a.active {
  box-shadow: 0 0 0 2px #1f5fa7, 0 0 0 4px rgba(31, 95, 167, 0.14);
}

.language-flag img {
  width: 28px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

/* ── Dark Theme Toggle Button ─────────────────────────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: #f0f6ff;
  border-color: #4a90e2;
  color: #4a90e2;
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Show sun in dark mode, moon in light mode */
[data-bs-theme="dark"] .theme-toggle-btn {
  background: rgba(33, 38, 45, 0.8);
  border-color: rgba(48, 54, 61, 0.8);
  color: #8b949e;
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(48, 54, 61, 0.9);
  border-color: #58a6ff;
  color: #58a6ff;
}

.theme-toggle-btn .icon-moon {
  display: block;
}

.theme-toggle-btn .icon-sun {
  display: none;
}

[data-bs-theme="dark"] .theme-toggle-btn .icon-moon {
  display: none;
}

[data-bs-theme="dark"] .theme-toggle-btn .icon-sun {
  display: block;
}

/* ── Mobile header ──────────────────────────────────────── */
.logo .logo-link,
.logo small,
.logo .text-muted {
  display: none !important;
}

.logo {
  display: none !important;
}

.site-title {
  text-align: left;
}

.language-flag {
  justify-content: flex-end;
  gap: 8px;
}

.lang-mobile-select {
  display: none;
  min-width: 140px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f5fa7;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ── Navigation Menu ──────────────────────────────────────── */
.main-menu {
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding: 8px 0;
}

.main-menu .nav {
  gap: 8px;
  flex-wrap: wrap;
}

.main-menu .nav-link {
  color: #2d4f76;
  font-weight: 500;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  padding: 8px 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.main-menu .nav-link:hover {
  background: #f2f7ff;
  border-color: rgba(37, 99, 178, 0.42);
  color: #1f5fa7;
  box-shadow: 0 8px 18px rgba(37, 99, 178, 0.16);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ── Content Layout ───────────────────────────────────────── */
.site-content {
  flex: 1;
  padding-bottom: 14px;
}

.banner_head {
  margin: 22px 0 12px;
  text-align: center;
}

.banner_head img,
.banner_head video,
.banner_head .banner_img {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: block;
  border-radius: 14px;
  border: 1px solid #dce7f5;
  box-shadow: var(--shadow);
}

.unique-tool {
  margin-top: 22px !important;
}

/* ── Form Container ───────────────────────────────────────── */
.form-container {
  width: min(100%, 780px);
  margin: 0 auto 26px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.form-container > header h2 {
  margin: 0;
  color: #1d4f8f;
  font-size: clamp(1.28rem, 2.2vw, 1.72rem);
  font-weight: 700;
}

.form-container > header p {
  color: var(--muted);
  font-size: 0.98rem;
}

.form-group label,
.mb-3 label {
  font-weight: 600;
  color: #334155;
}

/* ── Form Controls ───────────────────────────────────────── */
.form-control,
.form-control-file,
#customFile,
#copies,
textarea,
select,
input[type='number'],
input[type='file'] {
  border: 1px solid #cdd9ea;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
}

.form-control:focus,
#copies:focus,
textarea:focus,
select:focus,
input:focus {
  outline: none;
  border-color: #69a6eb;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Mobile: better touch targets */
@media (max-width: 640px) {
  input[type='file'],
  #customFile {
    padding: 14px 12px;
    min-height: 52px;
  }

  .form-control,
  #copies,
  textarea,
  select,
  input[type='number'] {
    padding: 12px;
    font-size: 1rem;
  }

  .btn,
  button[type='submit'],
  #uploadForm button[type='submit'] {
    padding: 14px 20px;
    font-size: 1.05rem;
  }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn,
button {
  border-radius: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
}

.btn-primary,
button[type='submit'],
#uploadForm button[type='submit'] {
  background: linear-gradient(180deg, var(--brand-green), #45a848);
  border-color: var(--brand-green);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(76, 175, 80, 0.28);
}

.btn-primary:hover,
button[type='submit']:hover,
#uploadForm button[type='submit']:hover {
  background: linear-gradient(180deg, #54bc59, var(--brand-green-dark));
  border-color: var(--brand-green-dark);
  color: #fff;
}

.btn-success {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border-color: #16a34a;
}

.btn-outline-primary {
  color: var(--brand-blue-dark);
  border-color: #9bbfe9;
  background: #f2f7ff;
}

.btn-outline-primary:hover {
  background: #e5effe;
  color: #184b88;
}

/* ── Sections ────────────────────────────────────────────── */
#resultPanel,
#feedbackContainer,
.alert,
.table-responsive,
section.info,
section.technologies,
section.usage-tips,
section.faq {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

#resultPanel,
#feedbackContainer,
.alert,
section.info,
section.technologies,
section.usage-tips,
section.faq {
  padding: 18px;
}

#resultPanel h3,
#feedbackContainer h3,
.info h2,
.technologies h3,
.usage-tips h3,
.faq h2 {
  color: #1f5fa7 !important;
}

.info,
.technologies,
.usage-tips,
.faq {
  margin-top: 18px !important;
}

.info p,
.technologies p,
.usage-tips p,
.faq p,
.info li {
  color: #475569 !important;
  line-height: 1.68;
}

/* ── Table ───────────────────────────────────────────────── */
.table {
  margin-bottom: 0;
}

.table thead th {
  background: #f0f6ff;
  border-bottom-color: #d2e2f7;
  color: #2d4f76;
}

.copy-addr {
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: #1f5fa7;
  word-break: break-all;
}

.copy-addr:hover {
  color: #113964;
}

/* ── Countdown Timer ─────────────────────────────────────── */
.countdown {
  --ring: #22c55e;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 12px;
}

.countdown__ring {
  width: 92px;
  height: 92px;
}

.countdown__bg {
  fill: none;
  stroke: #e5edf8;
  stroke-width: 8;
}

.countdown__fg {
  fill: none;
  stroke: var(--ring);
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.countdown__label {
  font-size: 0.82rem;
  color: #2f6cb3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.countdown__time {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.countdown__hint {
  font-size: 0.84rem;
  color: #64748b;
}

.countdown--expired .countdown__fg {
  stroke: #ef4444;
}

}

/* ── Telegram Float Button ───────────────────────────────── */
.telegram-icon {
  position: fixed;
  right: 16px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(246,250,255,0.9));
  border: 1px solid rgba(148,163,184,0.38);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
  transition: transform .18s ease, box-shadow .2s ease;
  animation: tgFloat 2.2s ease-in-out infinite;
}

.telegram-icon:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
}

.telegram-icon img {
  max-width: 72%;
  height: auto;
  display: block;
}

@keyframes tgFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* ── Auth Gate ──────────────────────────────────────────────── */
.ag-wrap {
  margin: 12px 0 20px;
}

/* ── Base card ───────────────────────────────────────────────── */
.ag-card {
  border-radius: 18px;
  padding: 14px 18px;
  border: 1px solid transparent;
  position: relative;
}

/* ══════════════════════════════════════════════════════════════
   GUEST CARD
   ══════════════════════════════════════════════════════════════ */
.ag-card--guest {
  background: linear-gradient(145deg, #f0f7ff, #dbeafe);
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
}
.ag-card--exhausted {
  background: linear-gradient(145deg, #fff4ed, #ffedd5);
  border-color: rgba(234, 88, 12, 0.25);
  box-shadow: 0 2px 12px rgba(234, 88, 12, 0.08);
}

/* Telegram circle icon */
.ag-guest-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc 0%, #006fa8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}
.ag-guest-icon svg {
  width: 22px;
  height: 22px;
  stroke: white;
}
.ag-card--exhausted .ag-guest-icon {
  background: linear-gradient(135deg, #ea580c 0%, #c2440c 100%);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.ag-guest-body {
  flex: 1;
  min-width: 0;
}
.ag-guest-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.3;
}
.ag-card--exhausted .ag-guest-title { color: #9a3412; }

/* Usage bar */
.ag-usage {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.ag-usage-track {
  flex-shrink: 0;
  width: 56px;
  height: 5px;
  border-radius: 99px;
  background: rgba(59, 130, 246, 0.15);
  overflow: hidden;
}
.ag-usage-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.4s ease;
}
.ag-card--exhausted .ag-usage-track { background: rgba(234,88,12,0.12); }
.ag-card--exhausted .ag-usage-fill  { background: #ea580c; }
.ag-usage-text {
  font-size: 0.82rem;
  color: #1d4ed8;
  font-weight: 500;
}
.ag-card--exhausted .ag-usage-text { color: #c2440c; }

.ag-guest-hint {
  margin-top: 5px;
  font-size: 0.79rem;
  color: #475569;
  line-height: 1.45;
}
.ag-guest-cta {
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   OK CARD (subscribed)
   ══════════════════════════════════════════════════════════════ */
.ag-card--ok {
  background: linear-gradient(145deg, #f0fdf4, #dcfce7);
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.07);
  display: flex;
  align-items: center;
  gap: 12px;
}
.ag-ok-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* Avatar circle */
.ag-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.3);
}
.ag-avatar--warn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
}

.ag-ok-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-username {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.ag-ok-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #15803d;
}
.ag-ok-badge svg {
  width: 13px;
  height: 13px;
  stroke: #15803d;
  stroke-width: 3.5;
  flex-shrink: 0;
}

/* Subtle logout link */
.ag-text-btn {
  background: none;
  border: none;
  font-size: 0.80rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.ag-text-btn:hover { color: #64748b; background: rgba(0,0,0,0.04); }
.ag-text-btn--warn { color: #a16207; }
.ag-text-btn--warn:hover { color: #78350f; background: rgba(245,158,11,0.08); }

/* ══════════════════════════════════════════════════════════════
   WARN CARD (needs subscription)
   ══════════════════════════════════════════════════════════════ */
.ag-card--warn {
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.09);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Funnel step tracker */
.ag-funnel {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.ag-funnel-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.ag-funnel-node {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}
.ag-funnel-node--done {
  background: #16a34a;
  color: white;
  box-shadow: 0 2px 8px rgba(22,163,74,0.35);
}
.ag-funnel-node--done svg { width: 13px; height: 13px; stroke: white; stroke-width: 3.5; }
.ag-funnel-node--active {
  background: #f59e0b;
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4), 0 0 0 3px rgba(245,158,11,0.2);
}
.ag-funnel-node--locked {
  background: #e2e8f0;
  color: #94a3b8;
}
.ag-funnel-node--locked svg { width: 13px; height: 13px; stroke: #94a3b8; }
.ag-funnel-label {
  font-size: 0.71rem;
  font-weight: 600;
  color: #78350f;
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ag-funnel-step--locked .ag-funnel-label { color: #94a3b8; }
.ag-funnel-step--done  .ag-funnel-label  { color: #15803d; }

/* Arrow connector */
.ag-funnel-arrow {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;           /* align with node height */
  color: #d97706;
  font-size: 1.2rem;
  margin-bottom: 23px;    /* offset below label */
  user-select: none;
}
.ag-funnel-arrow--dim { color: #d1d5db; }

/* Identity row inside funnel */
.ag-funnel-identity {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-left: 12px;
  flex-shrink: 0;
}
.ag-funnel-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #78350f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.ag-warn-hint {
  font-size: 0.83rem;
  color: #78350f;
  line-height: 1.45;
}

/* Action buttons row */
.ag-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Subscribe button (Telegram blue) */
.ag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.ag-btn-icon { display: flex; align-items: center; flex-shrink: 0; }
.ag-btn-icon svg { width: 15px; height: 15px; stroke: white; }

.ag-btn--subscribe {
  background: linear-gradient(135deg, #0088cc, #006fa8);
  color: white;
  box-shadow: 0 3px 12px rgba(0, 136, 204, 0.28);
}
.ag-btn--subscribe:hover {
  background: linear-gradient(135deg, #009de0, #0080c0);
  box-shadow: 0 5px 18px rgba(0, 136, 204, 0.38);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

.ag-btn--refresh {
  background: white;
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.45);
}
.ag-btn--refresh:hover {
  background: #fef3c7;
  border-color: rgba(245, 158, 11, 0.7);
}
.ag-btn--refresh:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Spinner inside refresh button */
.ag-spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(146,64,14,0.2);
  border-top-color: #92400e;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 3px;
}

/* Message area */
.ag-message {
  margin-top: 6px;
  font-size: 0.82rem;
  min-height: 1.1em;
}
.ag-message--error   { color: #dc2626; }
.ag-message--loading { color: #64748b; }

/* Inline links in tip texts */
.auth-inline-link,
.error-inline-link {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  margin: 0 2px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,178,.26);
  background: rgba(37,99,178,.08);
  color: #1f5fa7;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s ease;
}
.auth-inline-link:hover,
.error-inline-link:hover {
  background: rgba(37,99,178,.14);
  border-color: rgba(37,99,178,.42);
  color: #163f70;
  text-decoration: none;
}

/* Telegram pulse on focus */
.dw-auth-pulse {
  outline: 2px solid #bff45b;
  outline-offset: 3px;
  border-radius: 12px;
  box-shadow: 0 0 0 6px rgba(191,244,91,.18);
  transition: box-shadow .2s ease;
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════════════════════════════ */
[data-bs-theme="dark"] .ag-card--guest {
  background: linear-gradient(145deg, #0c1829, #0f1f35);
  border-color: rgba(59,130,246,0.2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
[data-bs-theme="dark"] .ag-card--exhausted {
  background: linear-gradient(145deg, #1c0d00, #2d1500);
  border-color: rgba(234,88,12,0.2);
}
[data-bs-theme="dark"] .ag-guest-title   { color: #93c5fd; }
[data-bs-theme="dark"] .ag-usage-text    { color: #60a5fa; }
[data-bs-theme="dark"] .ag-guest-hint    { color: #8b949e; }
[data-bs-theme="dark"] .ag-usage-track   { background: rgba(59,130,246,0.12); }
[data-bs-theme="dark"] .ag-card--exhausted .ag-usage-text { color: #fb923c; }
[data-bs-theme="dark"] .ag-card--exhausted .ag-guest-title { color: #fb923c; }

[data-bs-theme="dark"] .ag-card--ok {
  background: linear-gradient(145deg, #052e16, #14532d);
  border-color: rgba(34,197,94,0.2);
}
[data-bs-theme="dark"] .ag-avatar {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e16;
  box-shadow: 0 3px 8px rgba(74,222,128,0.25);
}
[data-bs-theme="dark"] .ag-username     { color: #e6edf3; }
[data-bs-theme="dark"] .ag-ok-badge     { color: #4ade80; }
[data-bs-theme="dark"] .ag-ok-badge svg { stroke: #4ade80; }
[data-bs-theme="dark"] .ag-text-btn     { color: #8b949e; }
[data-bs-theme="dark"] .ag-text-btn:hover { color: #c9d1d9; background: rgba(255,255,255,0.06); }

[data-bs-theme="dark"] .ag-card--warn {
  background: linear-gradient(145deg, #1c1000, #2d1e00);
  border-color: rgba(245,158,11,0.22);
}
[data-bs-theme="dark"] .ag-funnel-node--locked { background: #21262d; }
[data-bs-theme="dark"] .ag-funnel-node--locked svg { stroke: #484f58; }
[data-bs-theme="dark"] .ag-funnel-label { color: #fbbf24; }
[data-bs-theme="dark"] .ag-funnel-step--done  .ag-funnel-label { color: #4ade80; }
[data-bs-theme="dark"] .ag-funnel-step--locked .ag-funnel-label { color: #484f58; }
[data-bs-theme="dark"] .ag-funnel-arrow     { color: #fbbf24; }
[data-bs-theme="dark"] .ag-funnel-arrow--dim { color: #30363d; }
[data-bs-theme="dark"] .ag-funnel-name  { color: #fde68a; }
[data-bs-theme="dark"] .ag-avatar--warn { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1c0d00; }
[data-bs-theme="dark"] .ag-warn-hint    { color: #fde68a; }
[data-bs-theme="dark"] .ag-btn--refresh {
  background: rgba(255,255,255,0.06);
  color: #fde68a;
  border-color: rgba(245,158,11,0.28);
}
[data-bs-theme="dark"] .ag-btn--refresh:hover { background: rgba(245,158,11,0.14); }
[data-bs-theme="dark"] .ag-spinner { border-color: rgba(253,230,138,0.2); border-top-color: #fde68a; }
[data-bs-theme="dark"] .ag-text-btn--warn       { color: #fbbf24; }
[data-bs-theme="dark"] .ag-text-btn--warn:hover { color: #fde68a; background: rgba(245,158,11,0.08); }

[data-bs-theme="dark"] .auth-inline-link,
[data-bs-theme="dark"] .error-inline-link {
  color: #58a6ff;
  background: rgba(88,166,255,.08);
  border-color: rgba(88,166,255,.22);
}
[data-bs-theme="dark"] .auth-inline-link:hover,
[data-bs-theme="dark"] .error-inline-link:hover {
  background: rgba(88,166,255,.15);
  border-color: rgba(88,166,255,.4);
  color: #79c0ff;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .ag-card--guest { flex-wrap: wrap; }
  .ag-guest-cta { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
  .ag-funnel-identity { display: none; }  /* hide name in funnel on tiny screens */
  .ag-funnel-label { max-width: 52px; font-size: 0.68rem; }
  .ag-actions { flex-direction: column; align-items: stretch; }
  .ag-btn, .ag-text-btn--warn { justify-content: center; width: 100%; }
  .ag-username { max-width: 140px; }
}


/* ── Dark mode overrides ───────────────────────────────── */
[data-bs-theme="dark"] .auth-gate-card--guest {
  background: linear-gradient(135deg, rgba(15,23,42,.9), rgba(23,37,84,.85));
  border-color: rgba(59,130,246,.25);
}
[data-bs-theme="dark"] .auth-gate-card--ok {
  background: linear-gradient(135deg, rgba(5,46,22,.85), rgba(20,83,45,.8));
  border-color: rgba(34,197,94,.2);
}
[data-bs-theme="dark"] .auth-gate-card--warn {
  background: linear-gradient(135deg, rgba(69,26,3,.85), rgba(120,53,15,.7));
  border-color: rgba(245,158,11,.2);
}
[data-bs-theme="dark"] .auth-gate-username { color: #e6edf3; }
[data-bs-theme="dark"] .auth-gate-usage-text { color: #93c5fd; }
[data-bs-theme="dark"] .auth-gate-hint { color: #8b949e; }
[data-bs-theme="dark"] .auth-gate-badge.ok  { color: #4ade80; }
[data-bs-theme="dark"] .auth-gate-badge.warn { color: #fbbf24; }
[data-bs-theme="dark"] .auth-gate-avatar.ok {
  background: rgba(74,222,128,.12);
  color: #4ade80;
  border-color: rgba(74,222,128,.25);
}
[data-bs-theme="dark"] .auth-gate-avatar.warn {
  background: rgba(251,191,36,.1);
  color: #fbbf24;
  border-color: rgba(251,191,36,.22);
}
[data-bs-theme="dark"] .auth-gate-dot.avail {
  background: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.3);
}
[data-bs-theme="dark"] .auth-gate-dot.used {
  background: #30363d;
  border-color: #484f58;
}
[data-bs-theme="dark"] .auth-inline-link,
[data-bs-theme="dark"] .error-inline-link {
  color: #58a6ff;
  background: rgba(88,166,255,.08);
  border-color: rgba(88,166,255,.22);
}
[data-bs-theme="dark"] .auth-inline-link:hover,
[data-bs-theme="dark"] .error-inline-link:hover {
  background: rgba(88,166,255,.15);
  border-color: rgba(88,166,255,.4);
  color: #79c0ff;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 576px) {
  .auth-gate-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-gate-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .auth-gate-identity {
    width: 100%;
  }
}

/* ── File List Preview ──────────────────────────────────── */
.file-list-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
}

.file-list-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.file-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.file-list-item:last-child {
  border-bottom: none;
}

.fi-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.fi-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}

.fi-size {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.fi-status {
  flex-shrink: 0;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

[data-bs-theme="dark"] .file-list-preview {
  background: #0d1117;
  border-color: #30363d;
}

[data-bs-theme="dark"] .file-list-item {
  border-bottom-color: #21262d;
}

[data-bs-theme="dark"] .fi-name {
  color: #c9d1d9;
}

[data-bs-theme="dark"] .fi-size {
  color: #8b949e;
}

/* ── Upload Progress ──────────────────────────────────────── */
.upload-progress-wrap {
  padding: 4px 0;
}

.upload-progress-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

[data-bs-theme="dark"] .upload-progress-label {
  color: #8b949e;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  margin-top: auto;
  background: #1f2937;
  color: #e5edf8;
  border-top: 0;
}

footer p {
  margin: 0;
  color: #dbe7f7;
}

/* ── Responsive Breakpoints ───────────────────────────────── */
@media (max-width: 992px) {
  .top-header .container {
    grid-template-columns: minmax(0, 1fr) auto !important;
    justify-items: stretch;
    align-items: start;
    text-align: left;
    gap: 8px;
  }

  .site-title {
    text-align: left;
    padding-left: 12px;
  }

  .site-title h1 {
    margin-left: 0;
    margin-right: 0;
  }

  .language-flag {
    justify-content: flex-end;
    padding-right: 10px;
  }

  .language-flag.has-mobile-select a {
    display: none;
  }

  .language-flag.has-mobile-select .lang-mobile-select {
    display: inline-block;
  }

  .main-menu {
    max-height: 82px;
    overflow: hidden;
    transition: max-height .25s ease, padding .25s ease, border-color .2s ease, opacity .2s ease;
    will-change: max-height, opacity;
  }

  .main-menu.main-menu--hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
    border-bottom-color: transparent;
    opacity: 0;
    pointer-events: none;
  }

  .main-menu .nav {
    justify-content: center;
  }

  .main-menu .nav-item {
    margin: 2px;
  }

  .form-container {
    padding: 18px;
  }

  .auth-gate-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-gate-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-title h1,
  h1 {
    font-size: 1.02rem;
    line-height: 1.28;
    max-width: 17ch;
    margin-left: 12px;
    margin-right: 0;
    text-wrap: pretty;
  }

  .language-flag {
    padding-right: 8px;
    gap: 5px;
  }

  .logo .logo-link {
    font-size: 1.08rem;
  }

  .banner_head {
    margin-top: 14px;
  }

  .countdown {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .countdown__ring {
    margin: 0 auto;
  }

  .telegram-icon {
    width: 50px;
    height: 50px;
    padding: 8px;
    bottom: 14px;
    right: 12px;
  }
}

@media (max-width: 640px) {
  .auth-gate-wrap .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .auth-gate-card {
    border-radius: 14px;
    padding: 12px;
    gap: 10px;
  }

  .auth-gate-label {
    font-size: 0.72rem;
  }

  .auth-gate-info {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .auth-gate-user,
  .auth-gate-state {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .auth-gate-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .auth-gate-actions .btn {
    width: 100%;
  }

  .auth-gate-actions iframe {
    width: 100% !important;
    max-width: 100% !important;
  }

  .auth-inline-link,
  .error-inline-link {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    color: #1f5fa7;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 2px;
  }
}

@media (max-width: 992px) {
  .main-menu {
    display: none !important;
  }
}

/* FAQ dark mode text fixes */
[data-bs-theme="dark"] .text-gray-800 {
  color: #c9d1d9 !important;
}

[data-bs-theme="dark"] .faq button,
[data-bs-theme="dark"] .faq [role="button"] {
  color: #c9d1d9 !important;
}

[data-bs-theme="dark"] .faq .space-y-4 > div {
  background: #0d1117;
  border-color: #30363d !important;
}

[data-bs-theme="dark"] .faq [x-show],
[data-bs-theme="dark"] .faq div[class*="px-4"] {
  color: #adbac7 !important;
}

[data-bs-theme="dark"] .focus\:ring {
  --tw-ring-color: rgba(88, 166, 255, 0.4);
}


/* ── Error Modal ─────────────────────────────────────────────── */
.error-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.error-modal.d-none { display: none !important; }

.error-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.error-modal__panel {
  position: relative;
  background: #ffffff;
  border-radius: 22px;
  max-width: 400px;
  width: 100%;
  padding: 32px 28px 26px;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: errorModalIn 0.22s cubic-bezier(.34, 1.4, .64, 1);
  text-align: center;
}

@keyframes errorModalIn {
  from { transform: scale(0.88) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* X close button */
.error-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  padding: 0;
}
.error-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}
.error-modal__close svg { width: 14px; height: 14px; }

/* Alert icon circle */
.error-modal__icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border: 2px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.15);
}
.error-modal__icon svg {
  width: 26px;
  height: 26px;
  stroke: #ef4444;
  stroke-width: 2;
}

.error-modal__title {
  font-size: 1.06rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
  line-height: 1.3;
}

.error-modal__body {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
}

.error-modal__footer {
  margin-top: 24px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Override Bootstrap btn inside modal footer */
.error-modal__footer .btn {
  padding: 9px 30px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 100px;
  transition: all 0.16s ease;
}
.error-modal__footer .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.28);
}
.error-modal__footer .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 5px 18px rgba(59, 130, 246, 0.38);
  transform: translateY(-1px);
  border-color: transparent;
}
.error-modal__footer .btn-outline-primary {
  border-color: rgba(59, 130, 246, 0.5);
  color: #2563eb;
}
.error-modal__footer .btn-outline-primary:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3b82f6;
}

/* Dark mode */
[data-bs-theme="dark"] .error-modal__panel {
  background: #161b22;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}
[data-bs-theme="dark"] .error-modal__close {
  background: #21262d;
  color: #8b949e;
}
[data-bs-theme="dark"] .error-modal__close:hover {
  background: #30363d;
  color: #e6edf3;
}
[data-bs-theme="dark"] .error-modal__icon {
  background: linear-gradient(135deg, #300808, #450a0a);
  border-color: rgba(239, 68, 68, 0.2);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.1);
}
[data-bs-theme="dark"] .error-modal__title { color: #e6edf3; }
[data-bs-theme="dark"] .error-modal__body  { color: #8b949e; }
[data-bs-theme="dark"] .error-modal__footer .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ── Auth Avatar Icon ─────────────────────────────────────────── */
.ag-avatar-icon {
  width: 20px;
  height: 20px;
  stroke: white;
  stroke-width: 2;
}
[data-bs-theme="dark"] .ag-avatar .ag-avatar-icon { stroke: #052e16; }
[data-bs-theme="dark"] .ag-avatar--warn .ag-avatar-icon { stroke: #1c0d00; }

/* ── Inline progress spinner ─────────────────────────────── */
.progress-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(31, 95, 167, 0.2);
  border-top-color: #1f5fa7;
  border-right-color: #22c55e;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

[data-bs-theme="dark"] .progress-spinner {
  border-color: rgba(88, 166, 255, 0.2);
  border-top-color: #58a6ff;
  border-right-color: #3fb950;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}




/* ============================================================
   DESIGN POLISH v20260610  (redesign-skill + frontend-design)
   Additive only — refines typography, states, depth. Cyrillic-safe
   (Manrope). Works in both light and dark themes.
   ============================================================ */

/* ── Typography: give headlines real presence ────────────── */
.site-title h1,
h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.45rem, 3.4vw, 2.35rem);
  line-height: 1.1;
}
.form-container > header h2 {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.12;
}
.info h2, .faq h2, section.technologies h2, .info h3 {
  font-weight: 700;
  letter-spacing: -0.015em;
}
.logo .logo-link { font-weight: 800; letter-spacing: -0.01em; }

/* Tabular figures for every number that updates live (timer, counters,
   copies, countdown) — stops digit jitter. */
.overlay-queue__eta, .overlay-queue__meta,
.countdown__time, #copies, .progress, .progress-bar,
#uploadProgressLabel { font-variant-numeric: tabular-nums; }

/* ── Buttons: tactile press + accessible focus ───────────── */
.btn, button {
  transition: transform .15s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease, background .2s ease, filter .2s ease;
}
.btn:active, button:active { transform: translateY(0) scale(.985); }
.btn-primary, button[type='submit'], #uploadForm button[type='submit'] {
  box-shadow: 0 10px 22px rgba(76,175,80,.30), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover, button[type='submit']:hover, #uploadForm button[type='submit']:hover {
  box-shadow: 0 14px 30px rgba(76,175,80,.38), inset 0 1px 0 rgba(255,255,255,.3);
  filter: saturate(1.05);
}
.btn:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74,144,226,.45), 0 8px 20px rgba(15,23,42,.12);
}
[data-bs-theme="dark"] .btn:focus-visible,
[data-bs-theme="dark"] button:focus-visible {
  box-shadow: 0 0 0 3px rgba(88,166,255,.5);
}

/* ── Card: subtle lift + crisp edge highlight ────────────── */
.form-container {
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s ease;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}
.form-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(15,23,42,.16), inset 0 1px 0 rgba(255,255,255,.6);
}
[data-bs-theme="dark"] .form-container {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
}
[data-bs-theme="dark"] .form-container:hover {
  box-shadow: 0 22px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04);
}

/* ── Inputs: smoother focus ──────────────────────────────── */
.form-control, #copies, select, textarea, input[type='file'] {
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control:focus, #copies:focus, select:focus, textarea:focus, input:focus {
  box-shadow: 0 0 0 4px rgba(74,144,226,.16);
}

/* ── Processing timer overlay: premium, calm, alive ──────── */
.overlay-queue--inline {
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 20px rgba(15,23,42,.06);
}
.overlay-queue--inline .overlay-queue__title {
  font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  font-size: 11px; opacity: .85;
}
.overlay-queue--inline .overlay-queue__eta {
  margin-top: 8px; font-size: 24px; font-weight: 800; letter-spacing: -0.01em;
}
.overlay-queue--inline .overlay-queue__hint {
  margin-top: 8px; font-size: 12px; font-weight: 600; line-height: 1.35;
  color: #b45309;
}
[data-bs-theme="dark"] .overlay-queue--inline .overlay-queue__hint { color: #fbbf24; }

/* Animated progress bar shimmer (the bar I drive from real ETA) */
#uploadProgressBar {
  background-image: linear-gradient(180deg, var(--brand-green), #45a848);
  transition: width .6s cubic-bezier(.2,.7,.3,1);
}

/* ── A11y + motion niceties ──────────────────────────────── */
html { scroll-behavior: smooth; }
a:focus-visible, .nav-link:focus-visible {
  outline: 2px solid rgba(74,144,226,.6); outline-offset: 2px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}


/* ============================================================
   EMIL DESIGN ENGINEERING PASS  v20260610b
   Applying emil-design-eng (animation craft) + design-taste-frontend.
   Design read: redesign-PRESERVE of a consumer media tool. Dials
   VARIANCE 6 / MOTION 5 / DENSITY 4 — calm, responsive, not flashy.
   Principles: strong custom easing, sub-300ms UI, progress = linear,
   never animate from scale(0), tactile :active, entrances ease-out.
   ============================================================ */

:root {
  /* Strong custom curves — built-in CSS easings are too weak (Emil). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

/* 1 — Buttons feel responsive: tactile press + strong ease-out.
   Emil: scale(0.97) on :active, transition transform ~150ms ease-out. */
.btn, button {
  transition: transform .15s var(--ease-out), box-shadow .2s var(--ease-out), background .2s ease, filter .2s ease;
}
.btn:active, button:active { transform: translateY(0) scale(.97); }

/* 2 — Progress bars are CONSTANT motion → linear, never eased.
   The timer bar updates on a 1s tick, so match it for a smooth crawl. */
#uploadProgressBar { transition: width 1s linear; }
.progress-bar { transition: width 1s linear; }
.ag-usage-fill { transition: width .9s linear; }

/* 3 — Spinners: one speed, fast. A faster spinner *reads* as faster load. */
.progress-spinner { animation: spin .6s linear infinite; }
.ag-spinner { animation: spin .6s linear infinite; }

/* 4 — `transition: all` is banned (animates unintended props, janks).
   Specify exactly what moves. */
.ag-btn { transition: transform .15s var(--ease-out), box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.error-modal__footer .btn { transition: transform .15s var(--ease-out), box-shadow .2s ease, background .2s ease; }

/* 5 — Processing overlay enters instead of popping in.
   Emil: elements appearing with no transition feel broken; and nothing
   in the real world appears from scale(0) — start at .96 + opacity. */
.overlay-queue--inline { animation: overlayIn .28s var(--ease-out) both; }
@keyframes overlayIn {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1);  }
}

/* 6 — Result panel + feedback enter with the same calm ease-out. */
#resultPanel:not(.d-none), #feedbackContainer:not(.d-none) {
  animation: resultIn .3s var(--ease-out) both;
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* 7 — Card hover lift on the strong curve (was generic ease). */
.form-container {
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}

/* ── Drag & drop зона + удаление файла (UX 11.06.2026) ──────────── */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px 10px 6px;
  transition: border-color .15s ease, background .15s ease;
}
.drop-zone.drag-over {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.07);
}
.drop-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
  pointer-events: none;
  user-select: none;
}
.file-list-item .fi-remove {
  background: none;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 7px;
  margin-left: 4px;
  border-radius: 6px;
  flex: 0 0 auto;
  transition: color .12s ease, background .12s ease;
}
.file-list-item .fi-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.10);
}

/* ── Premium-гейт Hard (замок + апселл) ───────────────────────── */
.hard-lock, #hardPremiumBadge { color: #f59e0b; }
.form-check-input:disabled + .form-check-label { opacity: .7; cursor: pointer; }
.hard-upsell {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 12px;
}
.hard-upsell__title { font-size: 0.85rem; font-weight: 600; color: #92400e; margin-bottom: 8px; }
.hard-upsell__row { display: flex; flex-wrap: wrap; gap: 8px; }
.hard-upsell__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 10px; font-size: 0.82rem; font-weight: 600;
  text-decoration: none; transition: opacity .15s ease;
}
.hard-upsell__btn:hover { opacity: .9; text-decoration: none; }
.hard-upsell__btn--star { background: #229ED9; color: #fff; }
.hard-upsell__btn--boost { background: #fff; color: #b45309; border: 1px solid #fbbf24; }
.hard-upsell__hint { font-size: 0.72rem; color: #a16207; margin-top: 8px; }

/* Keep the paired Imagick and ffmpeg examples on one visual baseline. */
@media (min-width: 768px) {
  .technologies > .grid > div {
    display: flex;
    flex-direction: column;
  }

  .technologies > .grid > div > h3 {
    min-height: 6rem;
  }
}

@media (min-width: 1024px) {
  .technologies > .grid > div > h3 {
    min-height: 4rem;
  }
}
