/**
 * Sentinel Onboarding (Quick Setup) styles
 *
 * Compiled by Prepros to ../css/sentinel-onboarding.css.
 *
 * All rules live under .sentinel-onboarding / .sentinel-qs-* selectors so
 * nothing leaks into wp-admin chrome or other plugins.
 *
 * Visual identity follows the GetSentinel marketing theme:
 *   - Inter for body, Poppins for display
 *   - Emerald primary (#10b981), cyan secondary (#06b6d4)
 *   - Slate dark surfaces (#0f172a, #0b1220)
 */

/* ---------- Tokens (scoped) -------------------------------------------- */

.sentinel-onboarding,
.sentinel-qs-card,
.sentinel-qs-notice {
  --sentinel-primary:        #10b981;
  --sentinel-primary-soft:   rgba(16, 185, 129, 0.18);
  --sentinel-primary-dark:   #059669;
  --sentinel-secondary:      #06b6d4;
  --sentinel-purple:         #8b5cf6;
  --sentinel-purple-dark:    #7c3aed;
  --sentinel-dark:           #0f172a;
  --sentinel-deep:           #020617;
  --sentinel-slate-50:       #f8fafc;
  --sentinel-slate-100:      #f1f5f9;
  --sentinel-slate-200:      #e2e8f0;
  --sentinel-slate-300:      #cbd5e1;
  --sentinel-slate-400:      #94a3b8;
  --sentinel-slate-500:      #64748b;
  --sentinel-slate-600:      #475569;
  --sentinel-slate-700:      #334155;
  --sentinel-slate-800:      #1e293b;
  --sentinel-gradient-brand: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --sentinel-gradient-dark:  linear-gradient(135deg, #0b1220 0%, #111c2e 60%, #0a1322 100%);
  --sentinel-shadow-sm:      0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --sentinel-shadow-md:      0 6px 14px -4px rgba(15, 23, 42, 0.14), 0 2px 6px -2px rgba(15, 23, 42, 0.08);
  --sentinel-shadow-xl:      0 35px 70px -10px rgba(2, 8, 23, 0.55), 0 8px 24px -10px rgba(15, 23, 42, 0.30), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --sentinel-glow-brand:     0 0 0 6px rgba(16, 185, 129, 0.10), 0 12px 32px -6px rgba(16, 185, 129, 0.35);
  --sentinel-radius:         12px;
  --sentinel-radius-lg:      16px;
  --sentinel-radius-xl:      22px;
  --sentinel-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sentinel-font-display:   'Poppins', 'Inter', sans-serif;
  --sentinel-ease:           cubic-bezier(0, 0, 0.2, 1);
}

/* Honour reduced motion globally inside our scope */
@media (prefers-reduced-motion: reduce) {
  .sentinel-onboarding,
  .sentinel-onboarding *,
  .sentinel-qs-card,
  .sentinel-qs-card * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Sentinel eye + logo SVGs ---------------------------------- */

.sentinel-eye-svg,
.sentinel-logo-svg {
  display: inline-block;
  vertical-align: middle;
  color: inherit;
  overflow: visible;

  .sentinel-logo-eye {
    transform-origin: center;
    transition: transform 220ms var(--sentinel-ease);
    will-change: transform;
  }
}

/* ---------- Dashboard "Quick Setup" card ------------------------------ */

.sentinel-qs-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 14px 0 22px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 92% 0%, rgba(16, 185, 129, 0.08), transparent 50%),
    #fff;
  border: 1px solid var(--sentinel-slate-200);
  border-radius: var(--sentinel-radius-lg);
  box-shadow: var(--sentinel-shadow-md);
  font-family: var(--sentinel-font);
  color: var(--sentinel-slate-700);
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--sentinel-gradient-brand);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.45);
  }

  &::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 220px;
    height: 100%;
    background: repeating-linear-gradient(135deg, rgba(15, 23, 42, 0.04) 0 1px, transparent 1px 14px);
    opacity: 0.35;
    pointer-events: none;
  }

  &__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--sentinel-gradient-dark);
    color: var(--sentinel-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px;
    box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.4), inset 0 0 0 1px rgba(16, 185, 129, 0.4);

    &::after {
      content: '';
      position: absolute;
      inset: -2px;
      border-radius: 18px;
      box-shadow: 0 0 22px 2px rgba(16, 185, 129, 0.25);
      pointer-events: none;
    }

    .sentinel-qs-card__inspect-svg {
      display: block;
      width: 40px;
      height: auto;
      max-height: 46px;
      flex-shrink: 0;
    }
  }

  &__title {
    font-family: var(--sentinel-font-display);
    font-weight: 700;
    font-size: 18px;
    margin: 0 0 4px;
    color: var(--sentinel-dark);
  }

  &__body {
    margin: 0;
    font-size: 14px;
    color: var(--sentinel-slate-600);
    max-width: 64ch;
  }

  &__meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--sentinel-slate-500);

    .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--sentinel-primary);
      box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
    }
  }

  &__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
  }

  &__dismiss {
    background: transparent;
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--sentinel-slate-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: var(--sentinel-slate-100);
      color: var(--sentinel-slate-700);
    }
  }
}

/* ---------- Admin notice (upgrader / when pending) -------------------- */

.notice.sentinel-qs-notice {
  position: relative;
  background:
    linear-gradient(90deg, rgba(16, 185, 129, 0.05), transparent 60%),
    #fff;
  border: 1px solid var(--sentinel-slate-200);
  border-left: 4px solid var(--sentinel-primary);
  padding: 10px 36px 10px 44px;
  border-radius: 6px;
  font-size: 13.5px;
  box-shadow: var(--sentinel-shadow-sm);

  &::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at center, var(--sentinel-primary) 0 30%, transparent 31%);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.5), 0 0 12px rgba(16, 185, 129, 0.45);
    opacity: 0.9;
  }

  strong { color: var(--sentinel-dark); }

  a {
    color: var(--sentinel-primary);
    font-weight: 600;
    text-decoration: none;

    &:hover { text-decoration: underline; }
  }
}

/* ---------- Shared buttons (scoped) ----------------------------------- */

.sentinel-qs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: all 200ms var(--sentinel-ease);

  &--primary {
    background: #fff;
    color: var(--sentinel-primary);
    border-color: rgba(16, 185, 129, 0.32);
    box-shadow: var(--sentinel-shadow-sm);

    &:hover {
      background: var(--sentinel-gradient-brand);
      color: #fff;
      border-color: transparent;
      transform: translateY(-1px);
      box-shadow: var(--sentinel-glow-brand);
    }
  }

  &--secondary {
    background: #fff;
    color: var(--sentinel-slate-700);
    border-color: var(--sentinel-slate-300);

    &:hover {
      border-color: var(--sentinel-slate-400);
      color: var(--sentinel-dark);
    }
  }

  &--ghost {
    background: transparent;
    color: var(--sentinel-slate-600);
    border-color: transparent;

    &:hover { color: var(--sentinel-dark); }
  }

  &--plus {
    background: linear-gradient(135deg, var(--sentinel-purple) 0%, var(--sentinel-purple-dark) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 18px -6px rgba(124, 58, 237, 0.55);

    &::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
    }

    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 12px 28px -8px rgba(124, 58, 237, 0.65);
      color: #fff;
    }
  }

  &[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

/* ---------- Modal scope ----------------------------------------------- */

.sentinel-onboarding {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 40%, rgba(8, 16, 33, 0.55) 0%, rgba(2, 8, 23, 0.85) 75%),
    rgba(2, 8, 23, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--sentinel-font);
  color: var(--sentinel-slate-700);

  &.is-open {
    display: flex;
    animation: sentinelFadeIn 220ms var(--sentinel-ease) both;
  }

  *,
  *::before,
  *::after { box-sizing: border-box; }

  &__modal {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 80px);
    background: #fff;
    border-radius: var(--sentinel-radius-xl);
    box-shadow: var(--sentinel-shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sentinelPopIn 320ms var(--sentinel-ease) both;
  }

  /* Header band ------------------------------------------------------- */
  &__head {
    position: relative;
    padding: 20px 22px 14px;
    color: #e2e8f0;
    background: var(--sentinel-gradient-dark);
    // Iris motion + tight logo bounds occasionally paint slightly outside.
    overflow: visible;

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
        radial-gradient(circle at 80% 30%, rgba(16, 185, 129, 0.20), transparent 55%);
      pointer-events: none;
      opacity: 0.9;
    }

    &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.5), transparent);
    }
  }

  &__head-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  &__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--sentinel-font-display);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.01em;
  }

  &__brand-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    // Shrink-wrap the SVG — a fixed outer width left a gap before the divider.
    width: auto;
    max-width: 120px;
    height: 50px;
    color: #ffffff;
    overflow: visible;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.22));

    svg {
      display: block;
      width: auto;
      height: auto;
      max-width: 100%;
      max-height: 100%;
    }
  }

  &__brand-title {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.2;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 14px;

    small {
      font-family: var(--sentinel-font);
      font-weight: 500;
      font-size: 10.5px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(226, 232, 240, 0.7);
      margin-top: 2px;
    }
  }

  // WordPress core helper. Output exists in admin templates but the modal
  // is portal-rendered before the helper styles are guaranteed to apply,
  // so we replicate it here.
  .screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
  }

  &__step-counter {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.75);
    font-variant-numeric: tabular-nums;
  }

  &__close {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: rgba(226, 232, 240, 0.75);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: rgba(255, 255, 255, 0.06);
      color: #fff;
    }
  }

  /* Step progress bar ------------------------------------------------ */
  &__step-bar {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 5px;
    // Horizontal padding matches .sentinel-onboarding__head — do not add a
    // second left/right inset here or the bar no longer aligns with the logo.
    padding: 12px 0 0;
  }

  &__bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;

    &.is-done {
      background: var(--sentinel-primary);
      box-shadow: 0 0 10px rgba(16, 185, 129, 0.55);
    }

    &.is-active {
      background: linear-gradient(90deg, var(--sentinel-primary) 0%, rgba(16, 185, 129, 0.4) 100%);
      box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    }
  }

  /* Body ------------------------------------------------------------- */
  &__body {
    padding: 6px 28px 8px;
    overflow: auto;
    background:
      radial-gradient(circle at 0% 0%, rgba(16, 185, 129, 0.05), transparent 35%),
      radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.04), transparent 40%),
      linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    background-attachment: local;

    h3 {
      font-family: var(--sentinel-font-display);
      font-weight: 700;
      font-size: 22px;
      color: var(--sentinel-dark);
      margin: 0 0 6px;
    }

    p { font-size: 14px; margin: 0 0 12px; }
    p.lede { font-size: 14.5px; color: var(--sentinel-slate-600); margin-bottom: 14px; }

    label.sentinel-onboarding__label {
      display: block;
      font-weight: 600;
      color: var(--sentinel-dark);
      margin-bottom: 6px;
      font-size: 13px;
    }

    input[type="text"],
    input[type="password"] {
      width: 100%;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--sentinel-slate-300);
      font-family: inherit;
      font-size: 14px;
      color: var(--sentinel-dark);
      background: #fff;
      transition: border-color 200ms var(--sentinel-ease), box-shadow 200ms var(--sentinel-ease);

      &:focus {
        outline: none;
        border-color: var(--sentinel-primary);
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
      }
    }

    details {
      margin-top: 6px;
      font-size: 12.5px;
      color: var(--sentinel-slate-500);

      summary { cursor: pointer; }

      &[open] summary { color: var(--sentinel-slate-700); }
    }
  }

  /* Step hero illustration ------------------------------------------- */
  &__step-hero {
    position: relative;
    height: 132px;
    margin: 14px -4px 14px;
    border-radius: 16px;
    background:
      radial-gradient(circle at center, rgba(16, 185, 129, 0.10) 0%, transparent 60%),
      radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.06), transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      background-image:
        radial-gradient(circle, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        radial-gradient(circle, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
      background-size: 24px 24px, 12px 12px;
      background-position: 0 0, 6px 6px;
      opacity: 0.45;
      pointer-events: none;
    }

    .sentinel-onboarding__step-hero-svg {
      position: relative;
      z-index: 1;
      display: block;
      flex-shrink: 0;
      margin-inline: auto;
      overflow: visible;
    }
  }

  /* Sentinel+ promo card --------------------------------------------- */
  &__plus-promo {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(139, 92, 246, 0.32);
    border-radius: var(--sentinel-radius);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.07) 0%, rgba(99, 102, 241, 0.05) 100%);

    h4 {
      margin: 4px 0 6px;
      font-family: var(--sentinel-font-display);
      font-size: 16px;
      color: var(--sentinel-dark);
    }

    p {
      margin: 0;
      font-size: 13.5px;
      color: var(--sentinel-slate-600);
    }
  }

  &__plus-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sentinel-purple);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
  }

  &__plus-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    flex-wrap: wrap;
  }

  &__hint {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--sentinel-slate-500);

    a {
      color: var(--sentinel-primary);
      font-weight: 600;
      text-decoration: none;

      &:hover { text-decoration: underline; }
    }
  }

  &__link-purple {
    color: var(--sentinel-purple-dark);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;

    &:hover { text-decoration: underline; }
  }

  /* Profile cards ---------------------------------------------------- */
  &__profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 8px 0 4px;
  }

  &__profile {
    position: relative;
    padding: 14px 16px;
    border: 2px solid var(--sentinel-slate-200);
    border-radius: var(--sentinel-radius);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: all 200ms var(--sentinel-ease);

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, transparent 60%);
      opacity: 0;
      pointer-events: none;
      transition: opacity 200ms var(--sentinel-ease);
    }

    &:hover {
      border-color: var(--sentinel-primary);
      transform: translateY(-1px);
      box-shadow: var(--sentinel-shadow-md);

      &::after { opacity: 1; }
    }

    &.is-selected {
      border-color: var(--sentinel-primary);
      box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10), var(--sentinel-shadow-md);

      &::after { opacity: 1; }
    }

    h4 {
      font-family: var(--sentinel-font-display);
      font-weight: 700;
      margin: 0 0 4px;
      color: var(--sentinel-dark);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      position: relative;
      z-index: 1;
    }

    p {
      margin: 0;
      font-size: 13.5px;
      color: var(--sentinel-slate-600);
      position: relative;
      z-index: 1;
    }
  }

  &__pick-state {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--sentinel-slate-300);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #fff;
    font-size: 11px;
    flex-shrink: 0;
  }

  &__profile.is-selected &__pick-state {
    background: var(--sentinel-primary);
    border-color: var(--sentinel-primary);

    &::after { content: '✓'; }
  }

  /* Review diff table ----------------------------------------------- */
  &__diff {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;

    thead {
      text-align: left;

      th {
        padding: 8px 0;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--sentinel-slate-500);
      }
    }

    tbody {
      color: var(--sentinel-slate-700);

      td { padding: 6px 0; vertical-align: top; }
    }

    strong { color: var(--sentinel-primary); }
  }

  /* Footer ---------------------------------------------------------- */
  &__foot {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 22px 12px;
    border-top: 1px solid var(--sentinel-slate-100);
    background: #fff;
  }

  &__nav {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }

  &__credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--sentinel-slate-500);

    .credit-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--sentinel-primary);
      opacity: 0.8;
    }

    a {
      color: var(--sentinel-slate-600);
      font-weight: 600;
      text-decoration: none;

      &:hover { color: var(--sentinel-primary); }
    }
  }
}

@keyframes sentinelFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sentinelPopIn {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)     scale(1);    opacity: 1; }
}
