/* Shared Triggerly site pages (home, privacy, delete-account, …) */

:root {
  --bg: #0a0a0a;
  --surface: #121212;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #8a8a8a;
  --accent: #00c853;
  --accent-hover: #00e676;
  --border: rgba(255, 255, 255, 0.08);
  --error: #ff5252;
  --error-hover: #ff6b6b;
  --on-error: #ffffff;
  --content-max: 720px;
  --header-max: 960px;
  --page-pad-x: 20px;
  --page-pad-top: 32px;
  --page-pad-bottom: 48px;
  --section-gap: 20px;
  --page-header-gap: 32px;
  --page-header-pad-bottom: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

/* —— Site chrome —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header-inner {
  max-width: var(--header-max);
  margin: 0 auto;
  padding: 16px var(--page-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  min-width: 0;
}

.site-brand:hover .site-brand-text {
  color: var(--accent);
}

.site-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
}

.site-brand-text {
  line-height: 1;
  transition: color 0.15s ease;
}

/* —— Navigation —— */
.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 -8px 0 auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.site-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.site-nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: background 0.15s ease;
}

.site-nav-toggle-bars::before,
.site-nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}

.site-nav-toggle-bars::before {
  top: -6px;
}

.site-nav-toggle-bars::after {
  top: 6px;
}

.site-header.is-open .site-nav-toggle-bars {
  background: transparent;
}

.site-header.is-open .site-nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.site-header.is-open .site-nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.site-nav-backdrop[hidden] {
  display: none;
}

.site-nav-panel {
  display: flex;
  align-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav a.active {
  color: var(--accent);
  background: rgba(0, 200, 83, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 200, 83, 0.22);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.site-nav-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .site-header-inner {
    position: relative;
    z-index: 110;
  }

  .site-nav-toggle {
    display: inline-flex;
  }

  .site-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    width: min(300px, 88vw);
    height: 100dvh;
    height: 100vh;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 20px 28px;
    border-left: 1px solid var(--border);
    background: var(--surface);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
  }

  .site-header.is-open .site-nav-panel {
    transform: translateX(0);
    visibility: visible;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }

  .site-nav a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 12px;
  }
}

@media (prefers-color-scheme: light) {
  .site-nav-toggle {
    background: rgba(18, 18, 18, 0.04);
  }

  .site-nav-toggle:hover {
    background: rgba(18, 18, 18, 0.08);
  }

  .site-nav a:hover {
    background: rgba(18, 18, 18, 0.06);
  }

  .site-nav a.active {
    background: rgba(0, 140, 58, 0.1);
    box-shadow: inset 0 0 0 1px rgba(0, 140, 58, 0.2);
  }

  @media (max-width: 767px) {
    .site-nav-panel {
      box-shadow: -12px 0 40px rgba(18, 18, 18, 0.12);
    }

    .site-nav-backdrop {
      background: rgba(18, 18, 18, 0.35);
    }
  }
}

/* —— Page shell (shared horizontal alignment & vertical rhythm) —— */
.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
}

.page-header {
  margin-bottom: var(--page-header-gap);
  padding-bottom: var(--page-header-pad-bottom);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.page-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* —— Content cards —— */
main section {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: var(--section-gap);
  border: 1px solid var(--border);
}

main section:last-child {
  margin-bottom: 0;
}

main h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}

main p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

main p:last-child {
  margin-bottom: 0;
}

main ul,
main ol {
  margin: 0 0 14px;
  padding-left: 1.4rem;
  color: var(--text-secondary);
}

main li {
  margin-bottom: 8px;
}

main li:last-child {
  margin-bottom: 0;
}

.download-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 14px 24px;
  border-radius: 14px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.download-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

main a {
  color: var(--accent);
  text-decoration: none;
}

main a:hover {
  text-decoration: underline;
}

.contact-section {
  text-align: center;
  padding: 32px 26px 36px;
}

.contact-section h2 {
  margin-bottom: 12px;
}

.contact-lead {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.contact-email-line {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.6;
}

.contact-email {
  display: inline-block;
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.contact-email:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.site-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

/* —— Account deletion form —— */
#form-panel.hidden {
  display: none;
}

#success-panel {
  display: none;
}

#success-panel.visible {
  display: block;
}

.field {
  margin-bottom: 18px;
}

.field:last-of-type {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

input[type="email"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="email"]:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button[type="submit"] {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-hover);
}

button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.error-banner {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.35);
  color: #ff8a80;
  font-size: 0.9rem;
  line-height: 1.45;
}

.error-banner.visible {
  display: block;
}

.label-optional {
  font-weight: 400;
  color: var(--text-muted);
}

/* —— Account deletion flow —— */
.verify-panel {
  text-align: center;
}

.verify-lead {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.55;
}

.verify-hint {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.otp-input {
  position: relative;
  margin: 0 auto 24px;
  max-width: 360px;
  cursor: text;
}

.otp-hidden-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
}

.otp-cells {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 2.5vw, 11px);
}

.otp-cell {
  flex: 0 1 52px;
  width: 52px;
  max-width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.otp-cell-focused {
  border-color: rgba(0, 200, 83, 0.45);
  box-shadow: inset 0 0 0 1px rgba(0, 200, 83, 0.35);
  background: rgba(0, 200, 83, 0.08);
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Destructive actions — matches Android Delete Account (Material error / PriceNegative). */
.btn-destructive,
button[type="submit"].btn-destructive {
  background: var(--error);
  color: var(--on-error);
}

.btn-destructive:hover:not(:disabled),
button[type="submit"].btn-destructive:hover:not(:disabled) {
  background: var(--error-hover);
}

.btn-destructive:disabled,
button[type="submit"].btn-destructive:disabled {
  background: var(--surface);
  color: var(--text-muted);
  opacity: 1;
}

.resend-row {
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.text-btn {
  margin-left: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.text-btn:hover:not(:disabled) {
  text-decoration: underline;
}

.text-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.back-row {
  margin: 16px 0 0;
  font-size: 0.875rem;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.text-link:hover {
  text-decoration: underline;
}

/* —— Deletion success —— */
.success-panel {
  text-align: center;
  padding: 32px 26px 28px;
}

.success-illustration {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.success-check-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 200, 83, 0.12);
  border: 2px solid rgba(0, 200, 83, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-check-icon {
  width: 52px;
  height: 52px;
  color: var(--accent);
}

.success-logo {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--surface), 0 4px 16px rgba(0, 0, 0, 0.45);
}

.success-title {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.success-lead {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.6;
}

.warning-banner {
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.28);
  color: #ffb4ab;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}

.warning-banner strong {
  color: #ff8a80;
}

.success-home-btn {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
