:root {
  --bg-page: #09090b;
  --bg-card: #12151c;
  --bg-inset: #0e1016;
  --bg-hover: #171b24;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-blue: #2563eb;
  --accent-blue-hover: #3b82f6;
  --accent-emerald: #059669;
  --accent-emerald-hover: #10b981;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    sans-serif;
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1.25rem 1rem 2.5rem;
}

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

.sub-card {
  border-radius: 20px;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
}

.status-badge.expired {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.32);
  color: #fca5a5;
}

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--bg-inset);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.detail-value {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.renew-banner {
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.renew-banner[hidden] {
  display: none !important;
}

.renew-banner-text strong {
  display: block;
  font-size: 0.9rem;
  color: #fde68a;
  margin-bottom: 0.25rem;
}

.renew-banner-text p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #d4d4d8;
}

.renew-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.primary-cta-btn,
.secondary-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.primary-cta-btn {
  background: var(--accent-emerald);
  color: #ffffff;
}

.primary-cta-btn:hover {
  background: var(--accent-emerald-hover);
}

.secondary-cta-btn {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.secondary-cta-btn:hover {
  background: var(--bg-hover);
}

.secondary-cta-btn[hidden] {
  display: none !important;
}

.action-list,
.auto-import-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.92rem 1rem;
  border-radius: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

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

.action-btn-primary {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(59, 130, 246, 0.36);
}

.action-btn-primary:hover {
  background: rgba(37, 99, 235, 0.24);
}

.action-btn .icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

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

.action-btn .chevron {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 1.15rem;
}

.copy-button {
  justify-content: center;
}

.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;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }
}

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

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 430px;
  padding: 1rem 1.1rem 1.5rem;
  border-radius: 22px 22px 0 0;
  transform: translateY(24px);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 20px;
  }
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.9rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.modal-header .close-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-inset);
  color: var(--text-secondary);
  border-radius: 10px;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header .close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-body .action-btn {
  background-color: var(--bg-inset);
}

.modal-body .action-btn:hover {
  background-color: var(--bg-hover);
}

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

.modal-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 0.35rem;
  line-height: 1.45;
}

.qr-code-wrapper {
  background: #ffffff;
  padding: 1rem;
  border-radius: 16px;
  text-align: center;
  margin: 0 auto 0.35rem;
}

.qr-code-wrapper img,
.qr-code-wrapper canvas {
  display: block;
  margin: 0 auto;
  max-width: 210px;
  height: auto;
  border-radius: 8px;
}

.app-toggle-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background-color: var(--bg-inset);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 0.85rem;
}

.app-toggle-btn {
  flex: 1;
  min-width: 90px;
  border: none;
  background: transparent;
  padding: 0.52rem 0.6rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.app-toggle-btn.active {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.app-icon {
  height: 1rem;
  width: 1rem;
  object-fit: contain;
}

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

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

.os-title {
  margin: 0.35rem 0 0.1rem 0.25rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

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

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

.slide img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  background-color: var(--bg-inset);
}

.slide-text {
  font-size: 0.86rem;
  color: var(--text-primary);
  min-height: 2.8em;
  margin: 0.25rem 0 0.75rem;
}

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

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

.slider-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

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

.slider-nav-btn {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.slider-nav-btn.prev {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.slider-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sub-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: #181c25;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1200;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.sub-toast[hidden] {
  display: none !important;
}
