@import url("widget.css");

:root {
  --demo-primary: #5b6cf0;
  --demo-primary-dark: #3f4dcc;
  --demo-accent: #22c3a6;
  --demo-ink: #171a2b;
  --demo-muted: #6b7080;
  --demo-bg: #f6f7fb;
  --demo-card: #ffffff;
  --demo-border: #e6e8f0;
  --demo-radius: 14px;
  /* The one brand gradient, reused everywhere (hero, CTA band, wave
     dividers, widget banner, step badges) so every gradient on the page
     is visually identical instead of a slightly-different one-off. */
  --demo-gradient: linear-gradient(to right, #4c56d6, #22c3a6);
  --demo-gradient-from: #4c56d6;
  --demo-gradient-to: #22c3a6;
}

* {
  box-sizing: border-box;
}

body.demo-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--demo-bg);
  color: var(--demo-ink);
  line-height: 1.55;
}

a {
  color: var(--demo-primary);
}

.demo-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--demo-border);
}

.demo-nav a.demo-logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--demo-ink);
  text-decoration: none;
}

.demo-nav a.demo-logo span {
  color: var(--demo-primary);
}

.demo-nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.demo-nav-links a {
  color: var(--demo-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.demo-nav-links a:hover,
.demo-nav-links a.is-active {
  color: var(--demo-primary);
}

.demo-nav-links a.demo-btn {
  background: var(--demo-primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
}

.demo-nav-links a.demo-btn:hover {
  background: var(--demo-primary-dark);
  color: #fff;
}

/* Hero / gradient */

.demo-hero {
  background: var(--demo-gradient);
  color: #fff;
  padding: 96px 32px 110px;
  text-align: center;
}

.demo-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  max-width: 760px;
  margin: 0 auto 18px;
  letter-spacing: -0.01em;
}

.demo-hero p.demo-sub {
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.88);
}

.demo-hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.demo-btn-solid {
  background: #fff;
  color: var(--demo-primary-dark);
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.demo-btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.demo-nav-linkbtn {
  border: none;
  background: transparent;
  color: var(--demo-muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.demo-nav-linkbtn:hover {
  color: var(--demo-primary);
}

/* Sections */

.demo-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 70px 32px;
}

.demo-section h2 {
  font-size: 1.7rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.demo-section p.demo-lead {
  text-align: center;
  color: var(--demo-muted);
  max-width: 560px;
  margin: 0 auto 44px;
}

.demo-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 22px;
}

.demo-card {
  background: var(--demo-card);
  border: 1px solid var(--demo-border);
  border-radius: var(--demo-radius);
  padding: 18px 22px;
}

.demo-card .demo-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--demo-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 14px;
}

.demo-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.demo-card p {
  margin: 0;
  color: var(--demo-muted);
  font-size: 0.92rem;
}

.demo-cta-band {
  background: var(--demo-gradient);
  color: #fff;
  text-align: center;
  padding: 60px 32px 76px;
}

.demo-cta-band .demo-cta-inner {
  max-width: 640px;
  margin: 0 auto;
}

.demo-cta-band h2 {
  color: #fff;
}

.demo-cta-band .demo-hero-actions {
  margin-top: 22px;
}

.demo-footer {
  text-align: center;
  padding: 16px 30px;
  color: var(--demo-muted);
  font-size: 0.85rem;
}

/* SVG wave dividers between sections. The <path> fill is the color being
   transitioned INTO; the wave-divider's own background is the color being
   left, so the SVG's blank canvas above the curve reads as a continuation
   of the previous section instead of flashing the page's own background
   (which is what happens if the two colors are left to match by accident). */
.wave-divider {
  line-height: 0;
}

.wave-divider--from-hero,
.wave-divider--from-cta {
  background: var(--demo-gradient);
}

.wave-divider svg {
  width: 100%;
  height: auto;
}

/* Tour-operator demo page */

.tour-page {
  max-width: 760px;
  margin: 40px auto 24px;
  padding: 0 20px;
}

.tour-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3cd;
  color: #92660a;
  border: 1px solid #ffe69c;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #eef1ff;
  color: var(--demo-primary-dark);
}

.status-badge--active {
  background: #e6faf3;
  color: #1fae86;
}

.status-badge--expired,
.status-badge--cancelled {
  background: #fdeaea;
  color: #c0392b;
}

.tour-hero-image {
  height: 220px;
  border-radius: var(--demo-radius);
  background: linear-gradient(135deg, #ffb46b, #ff7597 60%, #7b6dfb);
  display: flex;
  align-items: flex-end;
  padding: 22px;
  color: #fff;
  margin-bottom: 22px;
}

.tour-hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tour-hero-flag img {
  display: block;
  width: 44px;
  height: 30px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.tour-hero-flag .esim-widget-flag-fallback {
  width: 44px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

.tour-hero-image h1 {
  margin: 0;
  font-size: 1.6rem;
}

.tour-card {
  background: var(--demo-card);
  border: 1px solid var(--demo-border);
  border-radius: var(--demo-radius);
  padding: 16px 24px 20px;
  margin-bottom: 20px;
}

.tour-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.tour-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--demo-border);
  font-size: 0.92rem;
}

.tour-meta-row:last-child {
  border-bottom: none;
}

.tour-meta-row .label {
  color: var(--demo-muted);
}

.tour-meta-row .value {
  font-weight: 700;
}

.tour-payment-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--demo-muted);
  cursor: pointer;
}

.tour-payment-toggle input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Docs page */

.docs-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 60px 32px 100px;
}

.docs-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.docs-page p.docs-lead {
  color: var(--demo-muted);
  margin-bottom: 44px;
}

.docs-own-partner-note {
  background: #eef1ff;
  border: 1px solid #c6cdfb;
  border-radius: var(--demo-radius);
  padding: 12px 16px;
  color: #3f4dcc;
  font-size: 0.88rem;
  margin: -24px 0 40px;
}

.docs-page h2 {
  font-size: 1.25rem;
  margin-top: 48px;
}

.docs-page h3 {
  font-size: 1rem;
  margin-top: 28px;
}

.docs-page .tour-card h2 {
  margin-top: 0;
}

.docs-page .tour-card h3:first-child,
.docs-page .key-item > label {
  margin-top: 0;
}

.docs-page h4 {
  font-size: 0.88rem;
  margin-top: 20px;
  color: var(--demo-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.88rem;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--demo-border);
}

.docs-code-block {
  position: relative;
  margin: 16px 0;
}

.docs-code-block pre {
  margin: 0;
  border-radius: 10px;
  max-height: 420px;
  overflow: auto;
}

.docs-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.docs-copy-btn.is-copied {
  background: var(--demo-accent);
  border-color: var(--demo-accent);
}

@media (max-width: 640px) {
  .demo-hero h1 {
    font-size: 2rem;
  }
  .demo-nav-links {
    gap: 12px;
  }
  .demo-nav-links a:not(.demo-btn) {
    display: none;
  }
}

.esim-field select,
.esim-field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--demo-border);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--demo-ink);
}

.esim-field textarea {
  resize: vertical;
}

.flag-carousel {
  overflow: hidden;
  margin: 8px 0 28px;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.flag-carousel-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: flag-scroll 40s linear infinite;
}

.flag-carousel:hover .flag-carousel-track {
  animation-play-state: paused;
}

.flag-carousel-flag {
  height: 32px;
  width: 46px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 14px;
  box-shadow: 0 1px 3px rgba(20, 24, 40, 0.15);
  flex: none;
}

@keyframes flag-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flag-carousel-track {
    animation: none;
  }
}

.login-btn {
  border-radius: 999px;
}

.brand-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-row .brand-field {
  flex: 1;
  min-width: 180px;
}

.brand-row--actions {
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 4px;
}

.brand-color-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-color-input input.brand-swatch {
  flex: none;
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.brand-color-input input[type="text"] {
  flex: 1;
  min-width: 0;
}

.brand-logo-field {
  min-width: 200px;
}

.lookup-result {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--demo-border);
  border-radius: var(--demo-radius);
  background: var(--demo-bg);
  max-width: 520px;
}

.lookup-details {
  flex: 1;
  min-width: 200px;
  font-size: 0.88rem;
}

.lookup-details .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--demo-border);
}

.lookup-details .row:last-child {
  border-bottom: none;
}

.lookup-details .label {
  color: var(--demo-muted);
}

.lookup-details .value {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.lookup-qr {
  flex: none;
  text-align: center;
}

.lookup-qr img {
  width: 150px;
  height: 150px;
  background: #fff;
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  padding: 6px;
}

.lookup-qr .esim-manual-code {
  display: block;
  margin-top: 8px;
  max-width: 162px;
  font-size: 0.66rem;
  color: var(--demo-muted);
  word-break: break-all;
}

.activity-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}

.activity-pager-btn {
  padding: 7px 14px;
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--demo-primary);
  text-decoration: none;
}

.activity-pager-btn:hover {
  background: #f6f7fb;
}

.activity-pager-btn.is-disabled {
  color: var(--demo-muted);
  opacity: 0.5;
  pointer-events: none;
}

.activity-pager-info {
  font-size: 0.85rem;
  color: var(--demo-muted);
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--demo-ink);
  cursor: pointer;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-slider {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--demo-border);
  transition: background 0.15s ease;
}

.mode-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.mode-switch input:checked + .mode-slider {
  background: #1f9d6b;
}

.mode-switch input:checked + .mode-slider::after {
  transform: translateX(18px);
}

.mode-switch input:disabled + .mode-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-state {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mode-state.is-test {
  background: #fff4e0;
  color: #b26a00;
}

.mode-state.is-live {
  background: #e4f8f1;
  color: #178a63;
}

button.mode-save-btn {
  width: auto;
  margin-left: auto;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.preview-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 6px;
}

.preview-heading-row h3 {
  margin: 0;
}

.preview-country-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--demo-border, #e6e8f0);
  font-size: 0.85rem;
  max-width: 260px;
}

.plans-table-wrap {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--demo-border, #e6e8f0);
  border-radius: 8px;
}

.plans-table-wrap table {
  margin: 0;
}

.plans-table-wrap thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.plan-id-cell {
  background: var(--demo-bg, #f6f7fb);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.82rem;
}

.preview-country-info {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--demo-muted, #6b7080);
}

.brand-flag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--demo-ink);
  cursor: pointer;
}

.brand-flag-toggle input {
  width: 16px;
  height: 16px;
  flex: none;
  cursor: pointer;
}

.brand-logo-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-input input[type="file"] {
  flex: 1;
  min-width: 0;
}

.brand-logo-thumb {
  flex: none;
  height: 42px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  background: #f6f7fb;
  border: 1px solid var(--demo-border);
  border-radius: 6px;
  padding: 4px;
}

.profile-stats {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 620px) {
  .profile-stats {
    grid-template-columns: 1fr;
  }
}

.keys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 620px) {
  .keys-grid {
    grid-template-columns: 1fr;
  }
}

.key-item > label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.key-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 4px;
}

.key-tag--public {
  background: #e4f8f1;
  color: #178a63;
}

.key-tag--secret {
  background: #fdeceb;
  color: #c0392b;
}

.key-hint {
  color: var(--demo-muted);
  font-size: 0.82rem;
  margin: 0 0 10px;
}

.brand-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.brand-lang-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.brand-lang-field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--demo-muted);
}

.brand-lang-field select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--demo-border);
  background: #fff;
  font-size: 0.95rem;
}

.brand-save-btn {
  width: auto;
  padding: 11px 20px;
  white-space: nowrap;
}

.brand-logo-remove {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
