/* Shared styles for the OpenWire marketing site and customer portal. */
:root {
  --bg: #0d0d0d;
  --bg-soft: #131313;
  --accent: #4AE8B8;
  --accent-dim: rgba(74, 232, 184, 0.12);
  --text: #f2f2f2;
  --text-2: rgba(255, 255, 255, 0.55);
  --text-3: rgba(255, 255, 255, 0.32);
  --line: rgba(255, 255, 255, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 32px; }

nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 13, 13, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; max-width: 1060px; margin: 0 auto;
  gap: 16px;
}
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  color: var(--text-2); font-size: 14px; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.nav-cta {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  line-height: 1.2;
}
.nav-links a.nav-cta:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.nav-current {
  color: var(--text-3);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

a.wordmark, a.wordmark:hover { color: var(--text); text-decoration: none; }
.wordmark { font-size: 20px; letter-spacing: 0.32em; white-space: nowrap; }
.wordmark .open { font-weight: 100; }
.wordmark .wire { font-weight: 650; }
.wordmark .vpn  { font-weight: 100; color: var(--accent); margin-left: 0.5em; }

header {
  position: relative; overflow: hidden;
  text-align: center; padding: 120px 32px 100px;
}
header::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 700px 520px at 50% 42%, var(--accent-dim), transparent 70%);
  pointer-events: none;
}
.hero-ring {
  position: relative; width: 200px; height: 200px; margin: 0 auto 56px;
}
.hero-ring .outer {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 60px rgba(74, 232, 184, 0.35), inset 0 0 40px rgba(74, 232, 184, 0.08);
  animation: breathe 4s ease-in-out infinite;
}
.hero-ring .dot {
  position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(74, 232, 184, 0.9);
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 60px rgba(74,232,184,0.35), inset 0 0 40px rgba(74,232,184,0.08); opacity: 1; }
  50%      { box-shadow: 0 0 90px rgba(74,232,184,0.55), inset 0 0 50px rgba(74,232,184,0.14); opacity: 0.85; }
}
.hero-wordmark { font-size: clamp(30px, 6vw, 54px); letter-spacing: 0.3em; margin-bottom: 28px; }
header h1 {
  font-size: clamp(20px, 3vw, 28px); font-weight: 200;
  color: var(--text-2); max-width: 640px; margin: 0 auto 48px;
}
header h1 strong { color: var(--text); font-weight: 400; }

.btn-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; position: relative; }
.btn {
  display: inline-block; padding: 14px 34px; border-radius: 999px;
  font-size: 15px; letter-spacing: 0.06em; transition: all 0.25s ease;
  cursor: pointer; font-family: inherit; line-height: 1.2; text-align: center;
}
button.btn { appearance: none; -webkit-appearance: none; }
.btn-primary { background: var(--accent); color: #062018; font-weight: 600; border: none; }
.btn-primary:hover { text-decoration: none; box-shadow: 0 0 40px rgba(74,232,184,0.45); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--text-2); font-weight: 400; background: transparent; }
.btn-ghost:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-block { display: block; width: 100%; }
.btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

section { padding: 90px 0; border-top: 1px solid var(--line); }
.kicker {
  font-size: 13px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px; font-weight: 500;
}
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 200; margin-bottom: 22px; letter-spacing: 0.01em; }
.lead { color: var(--text-2); font-weight: 300; max-width: 680px; font-size: 17px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 52px; }
.card {
  border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px;
  background: var(--bg-soft); transition: border-color 0.3s ease;
}
.card:hover { border-color: rgba(74, 232, 184, 0.35); }
.card .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 14px rgba(74,232,184,0.8); margin-bottom: 22px; }
.card h3 { font-size: 18px; font-weight: 500; margin-bottom: 10px; letter-spacing: 0.02em; }
.card p { color: var(--text-2); font-size: 15px; font-weight: 300; }

.open-list { margin-top: 44px; display: grid; gap: 0; }
.open-item {
  display: flex; gap: 26px; padding: 26px 6px; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.open-item:first-child { border-top: 1px solid var(--line); }
.open-item .num { color: var(--accent); font-weight: 200; font-size: 22px; min-width: 44px; }
.open-item h3 { font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.open-item p { color: var(--text-2); font-size: 15px; font-weight: 300; }

code {
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px; font-size: 0.9em;
  font-family: "SF Mono", ui-monospace, Menlo, monospace; color: var(--text);
}

footer { border-top: 1px solid var(--line); padding: 56px 0 64px; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
footer p { color: var(--text-3); font-size: 13px; font-weight: 300; max-width: 560px; }
footer .wordmark { font-size: 14px; }
footer .footer-links { margin-bottom: 10px; letter-spacing: 0.04em; }
footer .footer-links a { color: var(--text-2); }
footer .footer-links a:hover { color: var(--accent); }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page > main { flex: 1; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 30;
  background: var(--accent); color: #062018; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
}
.skip:focus { top: 12px; text-decoration: none; }

/* Customer portal */
.auth {
  display: flex; align-items: center; justify-content: center;
  padding: 56px 20px 72px; position: relative;
}
.auth::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 680px 460px at 50% 36%, var(--accent-dim), transparent 70%);
  pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1;
  width: min(440px, 100%);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 36px 32px;
}
.auth-card .kicker { margin-bottom: 12px; }
.auth-card h1 {
  font-size: 34px; font-weight: 200; letter-spacing: 0.01em; margin-bottom: 8px;
}
.auth-lead {
  color: var(--text-2); font-weight: 300; font-size: 15px; margin-bottom: 28px;
}
.auth-switch {
  margin-top: 22px; text-align: center;
  color: var(--text-2); font-size: 14px; font-weight: 300;
}

.field { margin-bottom: 16px; }
.field label, .label-row label {
  display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 8px; font-weight: 500;
}
.label-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.label-row a { font-size: 13px; color: var(--text-2); letter-spacing: 0; text-transform: none; }
.label-row a:hover { color: var(--accent); }
.field input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: 16px/1.4 inherit;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus {
  border-color: rgba(74, 232, 184, 0.75);
  box-shadow: 0 0 0 3px rgba(74, 232, 184, 0.14);
}
.field input:user-invalid {
  border-color: rgba(255, 138, 138, 0.75);
}
.field input:disabled {
  opacity: 1;
  color: var(--text-2);
  -webkit-text-fill-color: var(--text-2);
  cursor: not-allowed;
}
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #1a1a1a inset;
  transition: background-color 9999s ease-out;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin: -6px 0 16px; }

.checks { display: grid; gap: 12px; margin: 6px 0 20px; }
.check {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--text-2); font-size: 14px; font-weight: 300;
  cursor: pointer;
}
.check input {
  position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0;
}
.check .box {
  width: 18px; height: 18px; margin-top: 2px; flex: none;
  border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1a1a1a;
  display: grid; place-items: center;
}
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after {
  content: "";
  width: 8px; height: 5px;
  border-left: 2px solid #062018;
  border-bottom: 2px solid #062018;
  transform: translateY(-1px) rotate(-45deg);
}
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(74, 232, 184, 0.2); }
.check a { font-weight: 400; }

.or {
  display: flex; align-items: center; gap: 14px;
  color: var(--text-3); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; margin: 22px 0;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.fine { color: var(--text-3); font-size: 13px; font-weight: 300; line-height: 1.5; }
.demo-hint { margin: -12px 0 22px; }
.demo-cred {
  color: var(--text-2);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
}
.form-error {
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 300;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
}
.field input[aria-invalid="true"] { border-color: rgba(255, 255, 255, 0.28); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 40;
  width: min(420px, calc(100% - 32px));
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid rgba(74, 232, 184, 0.28);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 300;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.preview-note {
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 300;
  background: var(--accent-dim);
  border: 1px solid rgba(74, 232, 184, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
}
.preview-note a { font-weight: 500; }

.portal { padding: 64px 0 88px; }
.portal-head { margin-bottom: 8px; }
.portal-head h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 200;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
.portal-head .fine { margin-top: 12px; }
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 36px;
}
.portal-grid > .card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: auto; padding-top: 22px;
}
.card-actions .btn { padding: 12px 20px; }

.plan-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.plan-name { color: var(--text); font-size: 18px; font-weight: 500; letter-spacing: 0.02em; }
.price {
  color: var(--text);
  font-size: 34px; font-weight: 200; letter-spacing: -0.02em;
  margin: 4px 0 0;
}
.price span { font-size: 15px; color: var(--text-2); font-weight: 300; letter-spacing: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(74, 232, 184, 0.85);
}

.meta { margin-top: 18px; }
.meta > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.meta > div:last-child { border-bottom: none; padding-bottom: 0; }
.meta dt { color: var(--text-3); font-weight: 400; }
.meta dd { color: var(--text); text-align: right; font-weight: 400; overflow-wrap: anywhere; }

.pay-number {
  color: var(--text);
  font-size: 22px; font-weight: 300; letter-spacing: 0.12em;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  margin: 8px 0 6px;
}

.device { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.device + .device { border-top: 1px solid var(--line); }
.device:last-child { padding-bottom: 0; }
.device-mark {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.device-mark span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(74, 232, 184, 0.8);
}
.device-mark.is-quiet span { background: var(--text-3); box-shadow: none; }
.device-copy { min-width: 0; }
.device-name { color: var(--text); font-size: 16px; font-weight: 500; }
.device-copy p, .card .device-copy p { margin: 0; }
.device-state {
  margin-left: auto; flex: none;
  color: var(--accent);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
}
.device-state.is-quiet { color: var(--text-3); }

dialog.sheet {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  width: min(480px, calc(100% - 32px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
dialog.sheet::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sheet .kicker { margin-bottom: 10px; }
.sheet h2 { font-size: 28px; font-weight: 200; margin-bottom: 8px; }
.sheet .auth-lead { margin-bottom: 20px; }
.sheet-wide { width: min(560px, calc(100% - 32px)); }
.stack { display: grid; gap: 10px; margin-top: 8px; }

.invoice-list { list-style: none; margin: 8px 0 18px; }
.invoice-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.invoice-list .when { color: var(--text); font-weight: 400; }
.invoice-list .paid {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.invoice-list .amt {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--text);
}

::selection { background: rgba(74, 232, 184, 0.28); color: var(--text); }

@media (max-width: 800px) {
  .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta),
  .nav-current { display: none; }
  .nav-links { gap: 0; }
  header { padding: 80px 24px 70px; }
  section { padding: 64px 0; }
  .auth { padding: 36px 16px 56px; }
  .auth-card { padding: 32px 22px 26px; }
  .portal { padding: 40px 0 64px; }
  .card { padding: 28px 22px; }
  .field-row { grid-template-columns: 1fr; }
  .invoice-list li { grid-template-columns: 1fr auto; }
  .invoice-list .paid { display: none; }
}
@media (max-width: 420px) {
  .nav-inner { padding: 16px; }
  .wordmark { font-size: 15px; letter-spacing: 0.16em; }
  .nav-links a.nav-cta { padding: 8px 12px; }
  .wrap { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-ring .outer { animation: none; }
  .btn, .card, .field input { transition: none; }
}
