/* Стили для страницы "Доступ запрещен" (deny) в новом дизайне */

.deny-page {
  margin: 1.5rem 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.deny-card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.deny-card-header {
  text-align: center;
  padding: 1.75rem 2rem 1.25rem;
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
  border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
}

.deny-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deny-icon svg {
  width: 28px;
  height: 28px;
  color: #ef4444;
}

.deny-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.deny-reason {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

.deny-reason a {
  color: #f97316;
  font-weight: 500;
  text-decoration: none;
}

.deny-reason a:hover {
  text-decoration: underline;
}

.deny-card-body {
  padding: 1.25rem 2rem 1.5rem;
}

.deny-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.2s;
}

.deny-back-link:hover {
  color: #111827;
  text-decoration: none;
}

.deny-back-link svg {
  width: 16px;
  height: 16px;
}

/* Блок покупки */
.deny-purchase {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid hsl(214.3 31.8% 91.4%);
}

.deny-purchase-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin: 0 0 0.875rem;
}

/* Контейнер кнопок покупки */
.deny-actions {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.deny-action-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.deny-action-item .deny-buy-btn {
  flex: 1;
}

/* Общие стили кнопок покупки */
.deny-buy-btn,
.deny-buy-book-btn {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.5rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
}

.deny-buy-btn {
  background: #10b981;
}

.deny-buy-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.deny-buy-book-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.deny-buy-book-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  color: #fff;
  text-decoration: none;
}

.deny-buy-btn:active,
.deny-buy-book-btn:active {
  transform: translateY(0);
}

.deny-buy-price,
.deny-buy-book-price {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 0.1rem;
}

/* Разделитель "или" */
.deny-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: #9ca3af;
  font-size: 0.8rem;
}

.deny-divider::before,
.deny-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Блок абонементов */
.deny-tickets-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
}

.deny-tickets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.deny-ticket-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: 2rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.deny-ticket-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.deny-ticket-btn:active {
  transform: translateY(0);
}

/* Баланс */
.deny-balance {
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6b7280;
}

.deny-balance-value {
  font-weight: 700;
  color: #f97316;
  font-size: 1rem;
}

.deny-topup-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  border-radius: 0.375rem;
  background: #3b82f6;
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s ease;
}

.deny-topup-btn:hover {
  background: #2563eb;
}

/* Адаптивность */
@media (max-width: 480px) {
  .deny-page {
    margin: 0.75rem 0;
  }

  .deny-card-header {
    padding: 1.25rem 1rem 1rem;
  }

  .deny-card-body {
    padding: 1rem;
  }

  .deny-purchase {
    padding: 1rem;
  }

  .deny-title {
    font-size: 1.15rem;
  }

  .deny-actions {
    flex-direction: column;
  }

  .deny-tickets {
    flex-direction: column;
  }

  .deny-ticket-btn {
    justify-content: center;
  }
}

/* ===== Тёмная тема ===== */
body.dark-theme .deny-card {
  background: var(--dark-bg-card);
  border-color: var(--dark-border-primary);
  box-shadow: var(--dark-shadow-medium);
}

body.dark-theme .deny-card-header {
  background: linear-gradient(135deg, #2a1a1a 0%, var(--dark-bg-card) 100%);
  border-bottom-color: var(--dark-border-primary);
}

body.dark-theme .deny-icon {
  background: rgba(239, 68, 68, 0.15);
}

body.dark-theme .deny-title {
  color: var(--dark-text-primary);
}

body.dark-theme .deny-reason {
  color: var(--dark-text-secondary);
}

body.dark-theme .deny-reason a {
  color: var(--dark-accent-orange);
}

body.dark-theme .deny-back-link {
  color: var(--dark-text-secondary);
}

body.dark-theme .deny-back-link:hover {
  color: var(--dark-text-primary);
}

body.dark-theme .deny-purchase {
  background: var(--dark-bg-secondary);
  border-color: var(--dark-border-primary);
}

body.dark-theme .deny-purchase-title {
  color: var(--dark-text-muted);
}

body.dark-theme .deny-buy-btn {
  background: var(--dark-accent-green);
}

body.dark-theme .deny-buy-btn:hover {
  background: #45a049;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

body.dark-theme .deny-buy-book-btn {
  background: linear-gradient(135deg, #4a9eff, #3a8eff);
}

body.dark-theme .deny-buy-book-btn:hover {
  background: linear-gradient(135deg, #3a8eff, #2a7eff);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

body.dark-theme .deny-divider {
  color: var(--dark-text-muted);
}

body.dark-theme .deny-divider::before,
body.dark-theme .deny-divider::after {
  background: var(--dark-border-primary);
}

body.dark-theme .deny-tickets-label {
  color: var(--dark-text-secondary);
}

body.dark-theme .deny-ticket-btn {
  background: linear-gradient(135deg, #9b6dff, #8b5cf6);
}

body.dark-theme .deny-ticket-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

body.dark-theme .deny-balance {
  border-top-color: var(--dark-border-primary);
  color: var(--dark-text-secondary);
}

body.dark-theme .deny-balance-value {
  color: var(--dark-accent-orange);
}

body.dark-theme .deny-topup-btn {
  background: #4a9eff;
  color: #fff !important;
}

body.dark-theme .deny-topup-btn:hover {
  background: #3a8eff;
}

/* ===== Модальное окно покупки главы ===== */
dialog.modal-widget-default.deny-modal-styled {
  border-radius: 0.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border: none;
  padding: 0;
  max-width: 400px;
  width: calc(100% - 2rem);
}

dialog.modal-widget-animated.deny-modal-styled[open] > * {
  animation-name: deny-modal-slide !important;
}

@keyframes deny-modal-slide {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

dialog.deny-modal-styled > section {
  max-width: 100%;
  min-width: auto;
  padding: 0;
  gap: 0;
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
}

dialog.deny-modal-styled > section > header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  gap: 0.5rem;
}

dialog.deny-modal-styled > section > header > h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #111827;
}

dialog.deny-modal-styled > section > header > h2 .accent {
  color: inherit;
  font-weight: 700;
}

dialog.deny-modal-styled > section > header > button.close-modal {
  color: #9ca3af;
  font-size: 1.5rem;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 0.25rem;
}

dialog.deny-modal-styled > section > header > button.close-modal:hover {
  color: #111827;
  background: #f3f4f6;
}

dialog.deny-modal-styled > section > div {
  border-top: none;
  padding: 1.25rem;
  margin-top: 0;
  font-size: 0.875rem;
  color: #374151;
}

/* Контент модалки */
.dm-text {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
}

.dm-text strong {
  color: inherit;
  font-weight: 700;
}

.dm-denied {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #374151;
  line-height: 1.4;
}

.dm-denied a {
  color: #374151 !important;
  font-weight: 700;
  text-decoration: none;
}

.dm-guest {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.dm-guest a {
  color: #3b82f6;
  font-weight: 500;
  text-decoration: none;
}

.dm-guest a:hover {
  text-decoration: underline;
}

.dm-tickets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.dm-ticket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 1rem;
  border-radius: 2rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.dm-ticket-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(139, 92, 246, 0.3);
}

.dm-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: #374151;
}

.dm-balance strong {
  font-weight: 700;
}

.dm-topup-btn {
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  background: #3b82f6;
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.dm-topup-btn:hover {
  background: #2563eb;
}

.dm-actions {
  display: flex;
  gap: 0.5rem;
}

.dm-close-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #6b7280;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dm-close-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.dm-subscribe-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #10b981;
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dm-subscribe-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

/* ===== Тёмная тема для модалки (dark-theme + brightness-1/2 читалки) ===== */
body.dark-theme dialog.deny-modal-styled > section,
body.brightness-1 dialog.deny-modal-styled > section,
body.brightness-2 dialog.deny-modal-styled > section {
  background: #2a2a2a !important;
}

body.dark-theme dialog.deny-modal-styled > section > header,
body.brightness-1 dialog.deny-modal-styled > section > header,
body.brightness-2 dialog.deny-modal-styled > section > header {
  border-bottom-color: #404040 !important;
  background: #2a2a2a !important;
}

body.dark-theme dialog.deny-modal-styled > section > header > h2,
body.brightness-1 dialog.deny-modal-styled > section > header > h2,
body.brightness-2 dialog.deny-modal-styled > section > header > h2 {
  color: #ffffff !important;
}

body.dark-theme dialog.deny-modal-styled > section > header > h2 .accent,
body.brightness-1 dialog.deny-modal-styled > section > header > h2 .accent,
body.brightness-2 dialog.deny-modal-styled > section > header > h2 .accent {
  color: inherit !important;
  font-weight: 700 !important;
}

body.dark-theme dialog.deny-modal-styled > section > header > button.close-modal,
body.brightness-1 dialog.deny-modal-styled > section > header > button.close-modal,
body.brightness-2 dialog.deny-modal-styled > section > header > button.close-modal {
  color: #888 !important;
}

body.dark-theme dialog.deny-modal-styled > section > header > button.close-modal:hover,
body.brightness-1 dialog.deny-modal-styled > section > header > button.close-modal:hover,
body.brightness-2 dialog.deny-modal-styled > section > header > button.close-modal:hover {
  color: #fff !important;
  background: #404040 !important;
}

body.dark-theme dialog.deny-modal-styled > section > div,
body.brightness-1 dialog.deny-modal-styled > section > div,
body.brightness-2 dialog.deny-modal-styled > section > div {
  color: #b0b0b0 !important;
  border-top-color: #404040 !important;
  background: #2a2a2a !important;
}

body.dark-theme dialog.deny-modal-styled::backdrop,
body.brightness-1 dialog.deny-modal-styled::backdrop,
body.brightness-2 dialog.deny-modal-styled::backdrop {
  background-color: rgba(0, 0, 0, 0.75) !important;
}

body.dark-theme dialog.deny-modal-styled .dm-text,
body.brightness-1 dialog.deny-modal-styled .dm-text,
body.brightness-2 dialog.deny-modal-styled .dm-text {
  color: #b0b0b0 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-text strong,
body.brightness-1 dialog.deny-modal-styled .dm-text strong,
body.brightness-2 dialog.deny-modal-styled .dm-text strong {
  color: inherit !important;
  font-weight: 700 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-denied,
body.brightness-1 dialog.deny-modal-styled .dm-denied,
body.brightness-2 dialog.deny-modal-styled .dm-denied {
  color: #888 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-denied a,
body.brightness-1 dialog.deny-modal-styled .dm-denied a,
body.brightness-2 dialog.deny-modal-styled .dm-denied a {
  color: inherit !important;
  font-weight: 700 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-guest,
body.brightness-1 dialog.deny-modal-styled .dm-guest,
body.brightness-2 dialog.deny-modal-styled .dm-guest {
  color: #888 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-guest a,
body.brightness-1 dialog.deny-modal-styled .dm-guest a,
body.brightness-2 dialog.deny-modal-styled .dm-guest a {
  color: #4a9eff !important;
}

body.dark-theme dialog.deny-modal-styled .dm-ticket-btn,
body.brightness-1 dialog.deny-modal-styled .dm-ticket-btn,
body.brightness-2 dialog.deny-modal-styled .dm-ticket-btn {
  background: linear-gradient(135deg, #9b6dff, #8b5cf6) !important;
  color: #fff !important;
}

body.dark-theme dialog.deny-modal-styled .dm-ticket-btn:hover,
body.brightness-1 dialog.deny-modal-styled .dm-ticket-btn:hover,
body.brightness-2 dialog.deny-modal-styled .dm-ticket-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
}

body.dark-theme dialog.deny-modal-styled .dm-close-btn,
body.brightness-1 dialog.deny-modal-styled .dm-close-btn,
body.brightness-2 dialog.deny-modal-styled .dm-close-btn {
  background: #2d2d2d !important;
  border-color: #404040 !important;
  color: #b0b0b0 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-close-btn:hover,
body.brightness-1 dialog.deny-modal-styled .dm-close-btn:hover,
body.brightness-2 dialog.deny-modal-styled .dm-close-btn:hover {
  background: #404040 !important;
  color: #fff !important;
}

body.dark-theme dialog.deny-modal-styled .dm-subscribe-btn,
body.brightness-1 dialog.deny-modal-styled .dm-subscribe-btn,
body.brightness-2 dialog.deny-modal-styled .dm-subscribe-btn {
  background: #4caf50 !important;
  color: #fff !important;
}

body.dark-theme dialog.deny-modal-styled .dm-subscribe-btn:hover,
body.brightness-1 dialog.deny-modal-styled .dm-subscribe-btn:hover,
body.brightness-2 dialog.deny-modal-styled .dm-subscribe-btn:hover {
  background: #45a049 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-balance,
body.brightness-1 dialog.deny-modal-styled .dm-balance,
body.brightness-2 dialog.deny-modal-styled .dm-balance {
  background: #333 !important;
  color: #b0b0b0 !important;
}

body.dark-theme dialog.deny-modal-styled .dm-balance strong,
body.brightness-1 dialog.deny-modal-styled .dm-balance strong,
body.brightness-2 dialog.deny-modal-styled .dm-balance strong {
  color: #fff !important;
}

body.dark-theme dialog.deny-modal-styled .dm-topup-btn,
body.brightness-1 dialog.deny-modal-styled .dm-topup-btn,
body.brightness-2 dialog.deny-modal-styled .dm-topup-btn {
  background: #4a9eff !important;
  color: #fff !important;
}

body.dark-theme dialog.deny-modal-styled .dm-topup-btn:hover,
body.brightness-1 dialog.deny-modal-styled .dm-topup-btn:hover,
body.brightness-2 dialog.deny-modal-styled .dm-topup-btn:hover {
  background: #3a8eff !important;
}
