/* ============================================================================
   PinStreet — shared design system for the companion web pages
   ----------------------------------------------------------------------------
   Mirrors the app's tokens (src/index.css): dark-only, emerald primary,
   violet accent, Space Grotesk headings + Inter body, glass surfaces.
   Every page under safely-confirm/ links this file so the site reads as one
   product with the app. Page-specific rules go in a <style> block AFTER it.
   ========================================================================= */

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

:root {
  /* Surfaces — hsl values copied from the app's :root tokens.
     --ps-bg is #0C0E12 in hex; every page's <meta name="theme-color"> must use
     that literal so the browser/status-bar band matches the page behind it. */
  --ps-bg: hsl(220 20% 6%);
  --ps-bg-soft: hsl(220 20% 8%);
  --ps-card: hsl(220 20% 10% / 0.85);
  --ps-card-solid: hsl(220 20% 10%);
  --ps-elevated: hsl(0 0% 100% / 0.04);
  --ps-border: hsl(220 15% 25% / 0.5);
  --ps-border-strong: hsl(220 15% 30% / 0.7);

  /* Text */
  --ps-fg: hsl(0 0% 98%);
  --ps-fg-muted: hsl(220 10% 60%);
  --ps-fg-subtle: hsl(220 10% 45%);

  /* Brand */
  --ps-primary: hsl(160 84% 45%);
  --ps-primary-soft: hsl(160 84% 45% / 0.12);
  --ps-primary-ring: hsl(160 84% 45% / 0.3);
  --ps-accent: hsl(280 80% 60%);
  --ps-accent-soft: hsl(280 80% 60% / 0.12);
  --ps-danger: hsl(0 72% 55%);
  --ps-danger-soft: hsl(0 72% 55% / 0.12);

  /* Shape & motion */
  --ps-radius: 1rem;
  --ps-radius-lg: 1.75rem;
  --ps-radius-sm: 0.75rem;
  --ps-shadow: 0 24px 60px -20px hsl(220 40% 2% / 0.8);
  --ps-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ps-bg);
  color: var(--ps-fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  padding-top: calc(24px + env(safe-area-inset-top));
  position: relative;
  overflow-x: hidden;
}

/* Centered single-card layouts (confirm / add / reset-password) opt in. */
body.ps-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------- ambience */
/* Two soft brand-coloured orbs. Fixed + non-interactive, so they never
   intercept taps or scroll with long legal pages. */
.ps-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}

.ps-orb--primary {
  top: -160px;
  left: -140px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, hsl(160 84% 45% / 0.16), transparent 65%);
}

.ps-orb--accent {
  bottom: -180px;
  right: -140px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, hsl(280 80% 60% / 0.14), transparent 65%);
}

/* ------------------------------------------------------------------ typography */
h1,
h2,
h3,
h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ps-fg);
}

h1 {
  font-size: clamp(22px, 5vw, 26px);
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

a {
  color: var(--ps-primary);
  text-decoration: none;
  transition: opacity 0.2s var(--ps-ease);
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

strong {
  color: var(--ps-fg);
  font-weight: 600;
}

/* Secondary line under a heading (often the French/English counterpart). */
.ps-sub {
  color: var(--ps-fg-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ps-muted {
  color: var(--ps-fg-subtle);
  font-size: 13px;
}

/* --------------------------------------------------------------------- card */
.ps-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--ps-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  box-shadow: var(--ps-shadow);
  padding: 40px 30px 34px;
  text-align: center;
  animation: ps-rise 0.5s var(--ps-ease) both;
}

/* Long-form pages (privacy / terms / child-safety / delete-account). */
.ps-card--wide {
  max-width: 760px;
  text-align: left;
  padding: 40px 34px;
  margin: 0 auto;
}

@keyframes ps-rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------- logo */
.ps-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.ps-card--wide .ps-logo {
  justify-content: flex-start;
  margin-bottom: 24px;
}

.ps-logo__icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 18px hsl(280 80% 60% / 0.28);
}

.ps-logo__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The wordmark is 467x112 — always keep its aspect ratio, never crop to a square. */
.ps-logo__mark {
  height: 26px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

/* -------------------------------------------------------------------- badge */
.ps-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--ps-primary-soft);
  border: 1px solid var(--ps-primary-ring);
  color: var(--ps-primary);
  margin-bottom: 16px;
}

.ps-badge--neutral {
  background: var(--ps-elevated);
  border-color: var(--ps-border);
  color: var(--ps-fg-muted);
}

.ps-badge--danger {
  background: var(--ps-danger-soft);
  border-color: hsl(0 72% 55% / 0.3);
  color: hsl(0 80% 72%);
}

.ps-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------- status */
/* Big circular icon (success check, warning, etc.) */
.ps-status {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: var(--ps-primary-soft);
  border: 2px solid var(--ps-primary-ring);
  animation: ps-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.ps-status svg {
  width: 40px;
  height: 40px;
  stroke: var(--ps-primary);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ps-status--accent {
  background: var(--ps-accent-soft);
  border-color: hsl(280 80% 60% / 0.3);
}

.ps-status--accent svg {
  stroke: var(--ps-accent);
}

.ps-status--danger {
  background: var(--ps-danger-soft);
  border-color: hsl(0 72% 55% / 0.3);
}

.ps-status--danger svg {
  stroke: var(--ps-danger);
}

@keyframes ps-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ buttons */
.ps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: var(--ps-radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ps-ease), opacity 0.2s var(--ps-ease),
    background 0.2s var(--ps-ease), border-color 0.2s var(--ps-ease);
}

.ps-btn:hover {
  text-decoration: none;
  opacity: 0.92;
}

.ps-btn:active {
  transform: scale(0.985);
}

.ps-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ps-btn + .ps-btn {
  margin-top: 10px;
}

.ps-btn--primary {
  background: var(--ps-primary);
  color: hsl(220 20% 6%);
  box-shadow: 0 10px 26px -12px hsl(160 84% 45% / 0.75);
}

.ps-btn--secondary {
  background: var(--ps-elevated);
  border-color: var(--ps-border);
  color: var(--ps-fg-muted);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

.ps-btn--secondary:hover {
  border-color: var(--ps-border-strong);
  color: var(--ps-fg);
  opacity: 1;
}

/* --------------------------------------------------------------------- form */
.ps-field {
  text-align: left;
  margin-bottom: 14px;
}

.ps-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ps-fg-muted);
  margin-bottom: 7px;
}

.ps-field input {
  width: 100%;
  padding: 13px 16px;
  background: var(--ps-elevated);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  color: var(--ps-fg);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s var(--ps-ease), background 0.2s var(--ps-ease),
    box-shadow 0.2s var(--ps-ease);
}

.ps-field input::placeholder {
  color: var(--ps-fg-subtle);
}

.ps-field input:focus {
  border-color: var(--ps-primary);
  background: hsl(0 0% 100% / 0.06);
  box-shadow: 0 0 0 3px var(--ps-primary-soft);
}

/* ------------------------------------------------------------------ message */
.ps-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--ps-radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
  border: 1px solid transparent;
}

.ps-message--error {
  background: var(--ps-danger-soft);
  border-color: hsl(0 72% 55% / 0.25);
  color: hsl(0 85% 78%);
}

.ps-message--success {
  background: var(--ps-primary-soft);
  border-color: var(--ps-primary-ring);
  color: hsl(160 70% 70%);
}

/* -------------------------------------------------------------- steps panel */
.ps-panel {
  background: var(--ps-elevated);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 18px;
  text-align: left;
}

.ps-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ps-step + .ps-step {
  margin-top: 14px;
}

.ps-step__num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  background: var(--ps-accent-soft);
  border: 1px solid hsl(280 80% 60% / 0.3);
  color: hsl(280 80% 75%);
}

.ps-step__body {
  font-size: 14px;
  line-height: 1.45;
  color: hsl(0 0% 98% / 0.85);
}

.ps-step__body small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ps-fg-subtle);
}

/* ------------------------------------------------------- long-form / legal */
/* Wraps privacy, terms, child-safety and delete-account copy. */
.ps-prose {
  font-size: 15px;
  line-height: 1.7;
  color: hsl(0 0% 98% / 0.82);
  /* Legal copy contains long unbroken URLs and email addresses — never let one
     push the card wider than the viewport on a 360px phone. */
  overflow-wrap: break-word;
}

.ps-prose h1 {
  margin: 0 0 6px;
}

.ps-prose h2 {
  margin: 34px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--ps-border);
  color: var(--ps-fg);
}

/* The first section heading sits right under the title — no extra rule above. */
.ps-prose > h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 24px;
}

.ps-prose h3 {
  margin: 22px 0 8px;
  color: hsl(160 40% 78%);
}

.ps-prose p {
  margin: 0 0 14px;
}

.ps-prose ul,
.ps-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.ps-prose li {
  margin-bottom: 8px;
}

.ps-prose li::marker {
  color: var(--ps-primary);
}

.ps-prose hr {
  border: none;
  border-top: 1px solid var(--ps-border);
  margin: 28px 0;
}

.ps-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
  /* Long legal tables must scroll inside the card, never widen the page. */
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ps-prose th,
.ps-prose td {
  padding: 10px 14px;
  border: 1px solid var(--ps-border);
  text-align: left;
  vertical-align: top;
  /* Shared floor so the same table reads identically in every language —
     narrower than this and cells collapse into unreadable slivers. */
  min-width: 136px;
}

.ps-prose th,
.ps-prose tr.odd td:first-child,
.ps-prose tr.even td:first-child {
  background: var(--ps-elevated);
}

.ps-prose blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--ps-primary);
  background: var(--ps-elevated);
  border-radius: 0 var(--ps-radius-sm) var(--ps-radius-sm) 0;
  color: var(--ps-fg-muted);
}

.ps-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--ps-elevated);
  border: 1px solid var(--ps-border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ------------------------------------------------------------- page header */
/* Title block for long-form pages: wordmark + doc title + version line. */
.ps-doc-head {
  margin-bottom: 26px;
}

.ps-doc-head .ps-version {
  color: var(--ps-fg-subtle);
  font-size: 13px;
  margin-top: 4px;
}

/* Language switcher */
.ps-langbar {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ps-fg-subtle);
}

.ps-langbar a {
  color: var(--ps-fg-muted);
}

.ps-langbar a:hover {
  color: var(--ps-primary);
}

.ps-langbar__current {
  color: var(--ps-fg);
  font-weight: 600;
}

/* -------------------------------------------------------------- page footer */
.ps-foot {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 22px auto 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ps-fg-subtle);
  line-height: 1.7;
}

.ps-foot a {
  color: var(--ps-fg-muted);
}

/* ------------------------------------------------------------------ helpers */
.ps-hidden {
  display: none !important;
}

.ps-mt-sm {
  margin-top: 14px;
}

.ps-mt {
  margin-top: 22px;
}

.ps-mb {
  margin-bottom: 22px;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 560px) {
  body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ps-card {
    padding: 32px 22px 28px;
    border-radius: 24px;
  }

  .ps-card--wide {
    padding: 28px 20px;
  }

  .ps-prose {
    font-size: 14.5px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
