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

/* --- Постоянная темная тема --- */
:root {
  --bg-color: #1c1c1e;
  --card-gradient-start: #2c3e50;
  --card-gradient-end: #4b6cb7;

  --accent-color: #4b6cb7;
  --text-on-card: #ffffff;
  --text-primary: #f5f5f7;
  --text-secondary: #8e8e93;
  --action-bg: #2c2c2e;
  --action-border: rgba(255, 255, 255, 0.1);
  --modal-bg: #2c2c2e;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --close-btn-bg: #48484a;
  --close-btn-color: #e0e0e0;
  --tab-bg: #3a3a3c;
  --tab-active-bg: #525255;
  --tab-active-shadow: rgba(0, 0, 0, 0.3);
  --timer-bar-bg: #48484a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem 1rem;
}

.container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Карточка подписки --- */
.sub-card {
  border-radius: 24px;
  padding: 1.5rem;
  color: var(--text-on-card);
  background: linear-gradient(
    45deg,
    var(--card-gradient-start),
    var(--card-gradient-end)
  );
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.sub-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: rotate(30deg);
  opacity: 0.5;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex-grow: 1;
}

.detail-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-item:nth-child(1),
.detail-item:nth-child(3),
.detail-item:nth-child(2),
.detail-item:nth-child(4) {
  align-items: center;
  text-align: center;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 2px;
}

.detail-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.status-badge {
  font-size: 0.8rem;
  padding: 0.25em 0.7em;
  border-radius: 0.5em;
  font-weight: 600;
}

.status-badge.active {
  background: #4ade80;
  color: #14532d;
}

.status-badge.expired {
  background: #f87171;
  color: #7f1d1d;
}

/* --- Cписок серверов --- */
.server-list-card {
  padding: 1rem;
  border-radius: 16px;
  background: var(--action-bg);
  border: 1px solid var(--action-border);
  box-shadow: 0 4px 10px -5px var(--shadow-color);
}

.server-list-card h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.server-list-card h4 .icon {
  font-size: 1.1rem;
}

.server-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.server-tag {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: var(--tab-bg);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.server-tag.active {
  color: var(--text-primary);
  background-color: rgba(75, 108, 183, 0.15);
  border-color: var(--accent-color);
}

.server-tag.expired {
  color: var(--text-secondary);
  background-color: var(--tab-bg);
  text-decoration: line-through;
  opacity: 0.8;
}

/* --- Список действий --- */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--action-bg);
  border: 1px solid var(--action-border);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 10px -5px var(--shadow-color);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px -5px var(--shadow-color);
}

.action-btn .icon {
  font-size: 1.4rem;
  width: 24px;
  text-align: center;
}

.action-btn .chevron {
  margin-left: auto;
  color: var(--text-secondary);
  opacity: 0.5;
}

.action-btn .label {
  flex: 1;
  text-align: left;
}

.action-btn .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-button.copied .icon-copy,
.copy-button.copied .text-copy {
  display: none;
}

.copy-button.copied .icon-check,
.copy-button.copied .text-copied {
  display: inline-block;
}

.copy-button .icon-check,
.copy-button .text-copied {
  display: none;
}

.price-chip {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- Модальные окна --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--modal-bg);
  width: 100%;
  max-width: 450px;
  padding: 1rem 1rem 2rem 1rem;
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 0.5rem 0 1.2rem 0;
  text-align: center;
  position: relative;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-header .close-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  border: none;
  background: var(--close-btn-bg);
  color: var(--close-btn-color);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 28px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 70vh;
  padding-right: 5px;
}

.modal-body .action-btn {
  background-color: #3a3a3c;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-body .btn-icon {
  height: 1.5rem;
  width: 1.5rem;
  object-fit: contain;
}

.qr-code-wrapper {
  background: #fff;
  padding: 1rem;
  border-radius: 20px;
  text-align: center;
}

.qr-code-wrapper img {
  width: 100%;
  max-width: 250px;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

.qr-code-wrapper canvas {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 250px;
  border-radius: 12px;
}

.modal-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0.5rem 0 0 0;
}

#timed-notice-modal .modal-content {
  text-align: center;
  padding-bottom: 1.5rem;
}

#timed-notice-modal .modal-body p {
  margin-top: 0;
}

.timer-bar-container {
  width: 100%;
  background-color: var(--timer-bar-bg);
  border-radius: 4px;
  overflow: hidden;
  height: 6px;
  margin-top: 1.5rem;
}

.timer-bar-progress {
  width: 100%;
  height: 100%;
  background: var(--accent-color);
  border-radius: 4px;
  animation: countdown 4s linear forwards;
}

@keyframes countdown {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* --- Стили для табов --- */
.app-toggle-buttons {
  display: flex;
  background-color: var(--tab-bg);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1rem;
}

.app-toggle-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.6rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.app-toggle-btn.active {
  background: var(--tab-active-bg);
  color: var(--text-primary);
  box-shadow: 0 2px 8px -2px var(--tab-active-shadow);
}

.app-toggle-btn .app-icon {
  height: 1.1rem;
  width: 1.1rem;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}

.app-icon {
  height: 1.1rem;
  width: 1.1rem;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}

.app-content-panel {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.app-content-panel.active {
  display: flex;
}

.os-title {
  margin: 0.5rem 0 0.2rem 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
}

.os-title:first-child {
  margin-top: 0;
}

.os-title .os-icon {
  width: 18px;
  height: 18px;
}

/* --- СТИЛИ ДЛЯ СЛАЙДЕРА ИНСТРУКЦИЙ --- */
.slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slides {
  display: flex;
  transition: transform 0.3s ease-in-out;
}

.slide {
  min-width: 100%;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.slide img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 16px;
  margin-bottom: 1rem;
  background-color: var(--action-bg);
}

.slide-text {
  font-size: 1rem;
  font-weight: 500;
  min-height: 3.2em;
  margin-bottom: 1rem;
}

.slider-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.slider-dots {
  display: flex;
  gap: 8px;
}

.slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--tab-bg);
  transition: background-color 0.3s ease;
}

.slider-dots .dot.active {
  background-color: var(--accent-color);
}

.slider-nav-btn {
  background: var(--accent-color);
  color: var(--text-on-card);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.slider-nav-btn.prev {
  background: var(--tab-active-bg);
}

.slider-nav-btn:disabled {
  background: var(--tab-bg);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Исправление стиля даты */
.detail-value {
  font-size: 90%;
  word-wrap: break-word;
  line-height: 1.2;
}

.detail-item:nth-child(2) .detail-value {
  font-size: 80%;
  font-weight: 700;
}
