/* App-specific styles. Witivio tokens / components are loaded via
   w-tokens.css and w-components.css. Only resets and the page shell live here. */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--w-font-primary);
  font-size: var(--w-font-base);
  background: var(--w-bg-secondary);
  color: var(--w-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--w-primary); }
a:focus-visible { outline: 2px solid var(--w-primary); outline-offset: 2px; border-radius: var(--w-radius-sm); }

code {
  font-family: var(--w-font-mono);
  background: var(--w-bg-secondary);
  padding: 1px 6px;
  border-radius: var(--w-radius-sm);
  font-size: 0.9em;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--w-max-width-wide);
  margin: 0 auto;
  padding: var(--w-space-8) var(--w-space-6);
}

/* ── Get started page ────────────────────────────────────────────── */
.gs-page { max-width: 960px; }

.gs-tour-row {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--w-space-4);
}

.gs-card {
  margin-bottom: var(--w-space-6);
  display: block;
}

.gs-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--w-radius-full);
  background: var(--w-primary);
  color: var(--w-text-inverse);
  font-size: 12px;
  font-weight: 700;
  margin-right: var(--w-space-2);
}

.gs-steps {
  margin: 0 0 var(--w-space-4);
  padding-left: var(--w-space-6);
  display: grid;
  gap: var(--w-space-3);
}

.gs-steps li { line-height: 1.55; }

.gs-actions {
  display: flex;
  gap: var(--w-space-4);
  align-items: center;
  flex-wrap: wrap;
}

.gs-code {
  background: var(--w-bg-secondary);
  border: 1px solid var(--w-border-light);
  border-radius: var(--w-radius-md);
  padding: var(--w-space-3) var(--w-space-4);
  margin: var(--w-space-3) 0;
  overflow-x: auto;
  font-family: var(--w-font-mono);
  font-size: var(--w-font-sm);
  line-height: 1.5;
}

.gs-code code { background: transparent; padding: 0; font-size: inherit; }

/* ── Free-trial page ─────────────────────────────────────────────── */
.tr-page { max-width: 1040px; }

.tr-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--w-radius-2xl);
  padding: var(--w-space-12) var(--w-space-10);
  color: var(--w-white);
  background:
    radial-gradient(circle at 12% 15%, rgba(144, 49, 99, 0.42), transparent 55%),
    radial-gradient(circle at 88% 85%, rgba(46, 41, 81, 0.55), transparent 60%),
    var(--w-bg-hero);
}

/* Dead-end states (expired / suspended) drop the magenta glow so the page doesn't
   read as a sales pitch when there is nothing to start. */
.tr-hero--muted {
  background:
    radial-gradient(circle at 88% 85%, rgba(46, 41, 81, 0.45), transparent 60%),
    var(--w-bg-hero);
}

.tr-hero__badge {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--w-radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.tr-hero__title {
  margin: var(--w-space-5) 0 0;
  max-width: 26ch;
  font-size: var(--w-font-4xl);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.tr-hero__lead {
  margin: var(--w-space-5) 0 0;
  max-width: 58ch;
  font-size: var(--w-font-lg);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.tr-hero__lead strong { color: var(--w-white); font-weight: 600; }

.tr-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--w-space-5);
  margin-top: var(--w-space-8);
}

.tr-hero__actions form { margin: 0; }

.tr-hero__note {
  margin: var(--w-space-6) 0 0;
  max-width: 60ch;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.58);
}

.tr-hero__note strong { color: rgba(255, 255, 255, 0.78); font-weight: 600; }

.tr-grid,
.tr-split {
  display: grid;
  gap: var(--w-space-4);
}

.tr-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tr-split { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tr-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--w-space-4);
  border-radius: var(--w-radius-md);
  background: var(--w-primary-50);
  color: var(--w-primary);
}

.tr-feature__icon svg { width: 21px; height: 21px; }

.tr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--w-space-3);
}

.tr-list li {
  display: flex;
  gap: var(--w-space-3);
  align-items: flex-start;
  font-size: var(--w-font-sm);
  line-height: 1.55;
  color: var(--w-text-secondary);
}

.tr-list__mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: var(--w-radius-full);
  font-size: 11px;
  font-weight: 700;
}

.tr-list__mark--yes { background: rgba(0, 128, 128, 0.12); color: var(--w-teal); }
.tr-list__mark--cap { background: rgba(232, 168, 56, 0.18); color: #8B6520; }

.tr-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--w-space-4);
}

.tr-steps li {
  display: flex;
  gap: var(--w-space-3);
  align-items: flex-start;
  font-size: var(--w-font-sm);
  line-height: 1.55;
  color: var(--w-text-secondary);
}

.tr-steps strong { color: var(--w-text-primary); }

.tr-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--w-radius-full);
  background: var(--w-primary);
  color: var(--w-text-inverse);
  font-size: 12px;
  font-weight: 700;
}

.tr-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--w-space-6);
  padding: var(--w-space-8) var(--w-space-10);
  border-radius: var(--w-radius-2xl);
  background: var(--w-bg-tertiary);
}

.tr-cta form { margin: 0; }
.tr-cta__title { margin: 0; font-size: var(--w-font-2xl); font-weight: 700; letter-spacing: -0.01em; }
.tr-cta__lead { margin: var(--w-space-2) 0 0; font-size: var(--w-font-sm); color: var(--w-text-secondary); }

@media (max-width: 640px) {
  .tr-hero { padding: var(--w-space-8) var(--w-space-6); }
  .tr-cta { padding: var(--w-space-6); }
  .tr-hero__actions { gap: var(--w-space-4); }
}

/* ── Driver.js theming overrides (match Witivio brand) ───────────── */
.driver-popover {
  background: var(--w-bg-primary);
  color: var(--w-text-primary);
  border-radius: var(--w-radius-lg);
  box-shadow: var(--w-shadow-lg);
  font-family: var(--w-font-primary);
}

.driver-popover-title { color: var(--w-text-primary); font-weight: 700; }
.driver-popover-description { color: var(--w-text-secondary); }
.driver-popover-progress-text { color: var(--w-text-muted); }

.driver-popover-prev-btn,
.driver-popover-next-btn,
.driver-popover-close-btn {
  background: var(--w-primary);
  color: var(--w-text-inverse);
  border-radius: var(--w-radius-sm);
  text-shadow: none;
  border: none;
  font-family: var(--w-font-primary);
}

.driver-popover-prev-btn { background: transparent; color: var(--w-primary); border: 1px solid var(--w-primary); }
.driver-popover-prev-btn:hover { background: var(--w-primary-50); }

.driver-popover-next-btn:hover,
.driver-popover-close-btn:hover { background: var(--w-primary-hover); }

.driver-popover-arrow-side-top.driver-popover-arrow    { border-top-color:    var(--w-bg-primary); }
.driver-popover-arrow-side-bottom.driver-popover-arrow { border-bottom-color: var(--w-bg-primary); }
.driver-popover-arrow-side-left.driver-popover-arrow   { border-left-color:   var(--w-bg-primary); }
.driver-popover-arrow-side-right.driver-popover-arrow  { border-right-color:  var(--w-bg-primary); }

/* Tabs — pure-CSS radio tabs (no JS). The radio inputs are visually hidden and
   precede the list + panels so the `:checked ~ sibling` selectors can drive
   both the active-tab underline and panel visibility. */
.w-tabs__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.w-tabs__list {
  display: flex;
  gap: var(--w-space-2);
  border-bottom: 1px solid var(--w-border-default);
  margin-bottom: var(--w-space-4);
}

.w-tabs__tab {
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--w-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.w-tabs__tab:hover {
  color: var(--w-primary);
}

.w-tabs__panel {
  display: none;
}

#tab-usage:checked ~ .w-tabs__list label[for="tab-usage"],
#tab-billing:checked ~ .w-tabs__list label[for="tab-billing"] {
  color: var(--w-primary);
  border-bottom-color: var(--w-primary);
}

#tab-usage:checked ~ .w-tabs__panel--usage,
#tab-billing:checked ~ .w-tabs__panel--billing {
  display: block;
}
