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

:root {
  --bg-dark: #021b87;
  --bg-light: #2ec7d3;

  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);

  --text: rgba(255, 255, 255, 0.95);
  --text-soft: rgba(255, 255, 255, 0.72);

  --hover: rgba(255, 255, 255, 0.12);
  --active: rgba(255, 255, 255, 0.16);

  --danger: #ff5f73;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  border-radius: 28px;
  overflow: hidden;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 360px;
  height: auto;
  background: transparent !important;
  overflow: hidden;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
}

.popup {
  position: relative;
  z-index: 2;

  width: 100%;
  border-radius: 26px;

  background: rgba(20, 25, 40, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  border: 1px solid var(--glass-border);

  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);

  overflow: hidden;
}

.popup::before {
  content: "";

  position: absolute;
  inset: 0;

  background: radial-gradient(
    circle at top right,
    rgba(120, 220, 255, 0.16),
    transparent 30%
  );

  pointer-events: none;
}

.popup::after {
  content: "";

  position: absolute;
  inset: 0;

  border-radius: inherit;

  border-top: 1px solid rgba(255, 255, 255, 0.22);

  pointer-events: none;
}

.popup-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-title {
  margin-top: 8px;

  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-soft);

  max-height: 42px;
  overflow: hidden;
}

.popup-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  width: 100%;
  border: none;
  outline: none;

  padding: 14px 16px;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.12);
  color: var(--text);

  font-size: 0.95rem;
  font-weight: 500;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  cursor: pointer;

  transition: all 0.25s ease;
}

.btn:hover {
  background: var(--hover);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 20px rgba(255, 255, 255, 0.06);
}

.btn:active {
  transform: scale(0.98);
  background: var(--active);
}

.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(
    90deg,
    rgba(84, 161, 255, 0.45),
    rgba(110, 220, 255, 0.22)
  );

  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: linear-gradient(
    90deg,
    rgba(98, 173, 255, 0.55),
    rgba(123, 231, 255, 0.3)
  );
}

.btn-clear {
  background: rgba(255, 255, 255, 0.05);
}

.btn-clear:hover {
  background: rgba(255, 95, 115, 0.12);
  color: #fff;
}

.summary-box {
  margin-top: 4px;

  max-height: 240px;
  overflow-y: auto;

  padding: 18px;
  border-radius: 22px;

  background: rgba(255, 255, 255, 0.06);

  border: 1px solid rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(14px);
}

.summary-box::-webkit-scrollbar {
  width: 6px;
}

.summary-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
}

.summary-box h3 {
  margin-bottom: 12px;

  font-size: 0.95rem;
  font-weight: 600;
}

.summary-box ul {
  padding-left: 18px;
}

.summary-box li {
  margin-bottom: 10px;

  color: rgba(255, 255, 255, 0.86);
  line-height: 1.55;
  font-size: 0.9rem;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  padding: 20px 0;

  color: var(--text-soft);
  font-size: 0.92rem;
}

.spinner {
  width: 18px;
  height: 18px;

  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;

  animation: spin 0.8s linear infinite;
}

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

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 0.8rem;
  color: var(--text-soft);

  margin-top: 8px;
}

.popup-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);

  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
