/* Peekeasy login — skinned to the app's Cream theme (Palette.swift → warmCream):
   paper-cream surfaces, warm near-black ink, purple accent #6b5bd6. */
:root {
  --cream: #f5f1e8;
  --paper: #fbf9f3;
  --ink: #1c1a17;
  --muted: #6a655c;
  --faint: #9a938a;
  --border: #e4ddcf;
  --accent: #6b5bd6;
  --accent-ink: #ffffff;
  --error: #b53b46;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 460px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 12px 40px rgba(28, 26, 23, 0.08);
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
/* Walking-goat mark from the marketing site (goat-walk.svg), with a scaled-down
   version of its hop animation so it stays put in the small header. */
.brand .goat { width: auto; height: 42px; transform-origin: center bottom; animation: goat-hop 0.9s ease-in-out infinite; }
@keyframes goat-hop {
  0%, 100% { transform: translate(-2px, 0) rotate(-4deg); }
  30% { transform: translate(0, -6px) rotate(3deg) scaleX(0.97); }
  60% { transform: translate(2px, 0) rotate(4deg); }
  80% { transform: translate(1px, 1px) rotate(0deg) scaleX(1.03); }
}
@media (prefers-reduced-motion: reduce) { .brand .goat { animation: none; } }
.brand h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0 0 18px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(107, 91, 214, 0.15); }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; }
button:disabled { opacity: 0.55; cursor: default; }

.primary {
  width: 100%;
  height: 42px;
  margin-top: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
}
.primary:hover:not(:disabled) { filter: brightness(1.05); }

.oauth {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
}
.oauth:hover:not(:disabled) { border-color: var(--faint); }
.oauth .plogo { width: 18px; height: 18px; flex: 0 0 auto; }

.link {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  color: var(--muted);
  font-size: 13px;
}
.link:hover { color: var(--ink); }

.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.note { margin-top: 18px; font-size: 11.5px; color: var(--faint); }
.err { margin: 14px 0 0; color: var(--error); font-size: 13px; }

#status { text-align: center; padding: 18px 0; }
.spinner {
  width: 28px; height: 28px; margin: 4px auto 14px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #17150f; --paper: #201d16; --ink: #f0ebe0; --muted: #a49c8d;
    --faint: #766e60; --border: #322d22; --accent: #8b7bf0; --accent-ink: #14110b;
  }
  input { background: #14110b; }
  .oauth { background: #14110b; }
  .tier { background: #14110b; }
}

/* --- subscribe-specific --- */
.whoami {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-email { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-email b { color: var(--muted); font-weight: 600; }
.whoami .link { width: auto; margin-top: 0; flex: 0 0 auto; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent);
  padding: 4px 10px; border-radius: 999px; flex: 0 0 auto;
}
.badge.paid { color: #2e9e6b; background: color-mix(in srgb, #2e9e6b 15%, transparent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; align-items: stretch; }
@media (max-width: 440px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  position: relative;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.tier.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(107, 91, 214, 0.12); }
.ribbon {
  position: absolute; top: -9px; right: 14px;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent-ink); background: var(--accent); padding: 3px 8px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(107, 91, 214, 0.3);
}
.tier-name { font-size: 15px; font-weight: 700; }
.tier-price { display: flex; align-items: baseline; gap: 3px; }
.tier-price b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.tier-price span { font-size: 12px; color: var(--muted); }
.feats { list-style: none; margin: 4px 0 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.feats li { position: relative; padding-left: 20px; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.feats li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 13px; height: 13px;
  background: var(--accent); border-radius: 50%;
  -webkit-mask: no-repeat center/9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  mask: no-repeat center/9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.tier-btn { margin-top: 10px; }
.finenote { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--faint); }
#active .primary { margin-top: 4px; }
