/* ═══════════════════════════════════════════
   BRAND TOKENS — matches planckvpn.com / affiliate.planckvpn.com
═══════════════════════════════════════════ */
:root {
  --bg:          #08090A;
  --bg-card:     #0d0e10;
  --bg-card-2:   #111115;
  --bg-overlay:  rgba(8,9,10,.9);

  --indigo:        #5E6AD2;
  --indigo-dim:    rgba(94,106,210,.15);
  --indigo-border: rgba(94,106,210,.25);

  --text-1:      #e5e7ed;
  --text-2:      #8A8F98;
  --text-3:      #62666D;
  --text-4:      #3a3d44;

  --border-1:    #1a1a1f;
  --border-2:    #2E2E32;
  --border-3:    #585A5C;

  --red:         #f87171;
  --green:       #10b981;

  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
}

/* ═══════════════════════════════════════════
   RESET
═══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }

/* Subtle ambient indigo glow at top */
body::before {
  content: "";
  position: fixed;
  inset: -10% -20% auto -20%;
  height: 60vh;
  background: radial-gradient(60% 50% at 50% 0%, rgba(94,106,210,.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,9,10,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo { display: flex; align-items: center; gap: .65rem; }
.site-logo img { height: 26px; width: auto; }
.account-badge {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--indigo);
  border: 1px solid var(--indigo-border);
  background: var(--indigo-dim);
  border-radius: 99px;
  padding: .2rem .6rem;
}
.header-back {
  font-size: .82rem;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: color .15s;
}
.header-back:hover { color: var(--text-1); }

/* ═══════════════════════════════════════════
   MAIN AUTH AREA
═══════════════════════════════════════════ */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-intro { text-align: center; margin-bottom: .25rem; }
.auth-intro h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -0.025em;
  color: var(--text-1);
  margin-bottom: .35rem;
}
.auth-intro p { color: var(--text-3); font-size: .88rem; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border-1);
}
.tab {
  position: relative;
  padding: 1rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  text-align: center;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--text-2); }
.tab.is-active { color: var(--text-1); cursor: default; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: -1px;
  height: 2px;
  background: var(--indigo);
  border-radius: 2px;
}

.form-body {
  padding: 1.75rem 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fg { display: flex; flex-direction: column; gap: .4rem; }
.fg-row { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; }

label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
}
label .req { color: var(--indigo); margin-left: .1rem; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: .9rem;
  padding: .7rem .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: var(--text-4); }
input:hover:not(:focus) { border-color: var(--border-3); }
input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(94,106,210,.12);
}
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-1);
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset;
  caret-color: var(--text-1);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.6rem; }
.pw-toggle {
  position: absolute;
  right: .65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--text-1); background: var(--border-1); }

.text-link { color: var(--text-2); transition: color .15s; }
.text-link:hover { color: var(--indigo); }

.cb {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  user-select: none;
  font-size: .82rem;
  color: var(--text-2);
  position: relative;
}
.cb input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.cb .box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-3);
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.cb .box svg { opacity: 0; color: #fff; }
.cb input:checked + .box {
  background: var(--indigo);
  border-color: var(--indigo);
}
.cb input:checked + .box svg { opacity: 1; }
.cb input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(94,106,210,.18); }

.hint { font-size: .72rem; color: var(--text-3); margin-top: .1rem; }

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .75rem 1.25rem;
  background: #fff;
  color: var(--bg);
  font-weight: 500;
  font-size: .9rem;
  border-radius: var(--radius);
  transition: opacity .15s, transform .15s;
  margin-top: .35rem;
}
.btn-submit:hover  { opacity: .88; }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-submit .arrow { transition: transform .2s; }
.btn-submit:hover .arrow { transform: translateX(3px); }

.form-card-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-1);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: .75rem;
  color: var(--text-3);
}
.form-card-footer svg { flex-shrink: 0; }

.auth-alt {
  text-align: center;
  font-size: .85rem;
  color: var(--text-3);
}
.auth-alt a {
  color: var(--text-1);
  font-weight: 500;
  margin-left: .2rem;
  transition: color .15s;
}
.auth-alt a:hover { color: var(--indigo); }

.form-error {
  display: none;
  align-items: flex-start;
  gap: .55rem;
  padding: .65rem .8rem;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: var(--radius);
  color: var(--red);
  font-size: .82rem;
  margin-bottom: .35rem;
}
.form-error.is-visible { display: flex; }
.form-error svg { flex-shrink: 0; margin-top: 2px; }

.form-success {
  display: none;
  align-items: flex-start;
  gap: .55rem;
  padding: .65rem .8rem;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius);
  color: var(--green);
  font-size: .82rem;
  margin-bottom: .35rem;
}
.form-success.is-visible { display: flex; }

/* ═══════════════════════════════════════════
   PRICING / PLAN CARDS
═══════════════════════════════════════════ */
.plans-wrap {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}
.plans-intro { text-align: center; max-width: 580px; }
.plans-intro h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  margin-bottom: .65rem;
}
.plans-intro p { color: var(--text-2); font-size: .95rem; line-height: 1.55; }

/* Trust signals row */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  font-size: .8rem;
  color: var(--text-3);
}
.trust-row > span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.trust-row svg { color: var(--text-2); flex-shrink: 0; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  align-items: stretch;
}
@media (max-width: 880px) {
  .plans-grid { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; gap: 1.25rem; }
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.plan-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-3);
}
.plan-card.is-highlighted {
  background: linear-gradient(180deg, rgba(94,106,210,.07) 0%, var(--bg-card) 60%);
  border-color: var(--indigo-border);
  box-shadow: 0 0 0 1px var(--indigo-border), 0 24px 60px -28px rgba(94,106,210,.5);
}
@media (min-width: 881px) {
  .plan-card.is-highlighted { transform: scale(1.035); }
  .plan-card.is-highlighted:hover { transform: scale(1.035) translateY(-3px); }
}
.plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--indigo);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: .3rem .85rem;
  border-radius: 99px;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 6px 20px -8px rgba(94,106,210,.6);
}
.plan-name {
  font-size: .72rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 600;
  margin-bottom: .9rem;
}

/* Price display */
.plan-price-block { margin-bottom: 1.1rem; }
.plan-price-main {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  white-space: nowrap;
}
.plan-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 2.55rem;
  letter-spacing: -0.035em;
  color: var(--text-1);
  line-height: 1;
}
.plan-cycle { color: var(--text-3); font-size: .92rem; }
.plan-meta-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .55rem;
  font-size: .8rem;
  flex-wrap: wrap;
}
.plan-strike { color: var(--text-4); text-decoration: line-through; }
.plan-savings {
  display: inline-flex;
  align-items: center;
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.28);
  color: var(--green);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .04em;
  padding: .18rem .55rem;
  border-radius: 99px;
}
.plan-billed { color: var(--text-3); font-size: .78rem; margin-top: .55rem; }

/* Divider line */
.plan-divider { height: 1px; background: var(--border-1); margin: .25rem 0 1.1rem; }

.plan-features {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.plan-features li {
  display: flex;
  gap: .55rem;
  font-size: .87rem;
  color: var(--text-1);
  line-height: 1.45;
  align-items: flex-start;
}
.plan-features svg { color: var(--green); flex-shrink: 0; margin-top: 3px; }

.plan-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .8rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .15s, transform .15s, background .15s, color .15s, border-color .15s;
  border: 1px solid var(--border-3);
  background: var(--bg);
  color: var(--text-1);
}
.plan-btn:hover {
  background: var(--bg-card-2);
  border-color: var(--text-3);
  transform: translateY(-1px);
}
.plan-card.is-highlighted .plan-btn {
  background: #fff;
  color: var(--bg);
  border-color: #fff;
  box-shadow: 0 8px 24px -10px rgba(255,255,255,.2);
}
.plan-card.is-highlighted .plan-btn:hover { opacity: .92; transform: translateY(-1px); }

.plan-btn .arrow { transition: transform .2s; }
.plan-btn:hover .arrow { transform: translateX(3px); }

/* Below-cards trust footer */
.plans-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-size: .78rem;
  color: var(--text-3);
  max-width: 600px;
  text-align: center;
  line-height: 1.55;
}
.plans-foot svg { color: var(--text-2); flex-shrink: 0; }

/* Subscription summary on dashboard */
.sub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card-2);
  border: 1px solid var(--border-2);
}
.sub-banner.is-active { border-color: var(--indigo-border); background: var(--indigo-dim); }
.sub-banner.is-warn   { border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.05); }
.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 99px;
}
.sub-pill.s-active   { color: var(--green); background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); }
.sub-pill.s-trialing { color: var(--indigo); background: var(--indigo-dim); border: 1px solid var(--indigo-border); }
.sub-pill.s-past_due,.sub-pill.s-unpaid { color: var(--red); background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); }
.sub-pill.s-canceled { color: var(--text-3); background: var(--bg); border: 1px solid var(--border-2); }

.payments-list { display: flex; flex-direction: column; }
.payments-list .dash-row .v { font-variant-numeric: tabular-nums; }
.payments-list a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 2px; }
.payments-list a:hover { color: var(--indigo); }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border-1);
  padding: 1.5rem 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { height: 20px; width: auto; opacity: .55; }
.footer-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-meta a, .footer-meta span {
  font-size: .76rem;
  color: var(--text-3);
  transition: color .15s;
}
.footer-meta a:hover { color: var(--text-2); }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 540px) {
  main { padding: 2rem 1rem 3rem; }
  .form-body { padding: 1.5rem 1.25rem 1rem; }
  .form-card-footer { padding: .9rem 1.25rem; }
  .tab.is-active::after { left: 1.25rem; right: 1.25rem; }
  .auth-intro h1 { font-size: 1.45rem; }
  .header-back span { display: none; }
}

/* ═══════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 14px; height: 14px; animation: spin .7s linear infinite; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════════
   APP NAV — authenticated pages (dashboard, pricing)
═══════════════════════════════════════════ */
.app-nav .header-inner { gap: 1rem; }
.nav-left  { display: flex; align-items: center; gap: 1.6rem; min-width: 0; }
.nav-right { display: flex; align-items: center; gap: .5rem; }

.nav-links { display: flex; align-items: center; gap: .15rem; }
.nav-link {
  font-size: .85rem;
  color: var(--text-2);
  padding: .42rem .7rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color .15s, background .15s, box-shadow .15s;
}
.nav-link:hover { color: var(--text-1); background: var(--border-1); }
.nav-link.is-active {
  color: var(--text-1);
  background: var(--indigo-dim);
  box-shadow: inset 0 0 0 1px var(--indigo-border);
}

/* Account menu — native <details> disclosure, works without JS */
.acct { position: relative; }
.acct > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .55rem .25rem .25rem;
  border-radius: 99px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary::marker { content: ""; }
.acct > summary:hover,
.acct[open] > summary { background: var(--bg-card-2); border-color: var(--border-2); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .74rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6b77e0, #454fb0);
  box-shadow: 0 2px 10px -3px rgba(94,106,210,.7), inset 0 1px 0 rgba(255,255,255,.18);
  flex-shrink: 0;
  user-select: none;
}
.email-sm {
  font-size: .82rem;
  color: var(--text-2);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct .chev { color: var(--text-3); transition: transform .2s ease; flex-shrink: 0; }
.acct[open] .chev { transform: rotate(180deg); }

.acct-menu {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: 248px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px -16px rgba(0,0,0,.7);
  padding: .4rem;
  z-index: 60;
  transform-origin: top right;
  animation: menu-pop .15s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes menu-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.acct-head { padding: .55rem .6rem .6rem; }
.acct-head .nm { font-size: .86rem; color: var(--text-1); font-weight: 500; line-height: 1.3; }
.acct-head .em {
  font-size: .76rem; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-verif {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .5rem;
  font-size: .67rem; font-weight: 600; letter-spacing: .02em;
  padding: .18rem .5rem; border-radius: 99px;
}
.acct-verif.ok { color: var(--green); background: rgba(16,185,129,.1);  border: 1px solid rgba(16,185,129,.28); }
.acct-verif.no { color: var(--red);   background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.28); }
.acct-sep { height: 1px; background: var(--border-1); margin: .3rem .2rem; }
.acct-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .6rem;
  border-radius: var(--radius);
  font-size: .85rem; color: var(--text-2);
  transition: background .15s, color .15s;
}
.acct-item svg { color: var(--text-3); flex-shrink: 0; transition: color .15s; }
.acct-item:hover { background: var(--border-1); color: var(--text-1); }
.acct-item:hover svg { color: var(--text-2); }
.acct-item.danger:hover { background: rgba(248,113,113,.08); color: var(--red); }
.acct-item.danger:hover svg { color: var(--red); }

/* Staggered page-load reveal for dashboard blocks */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dash-grid > * { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
.dash-grid > :nth-child(1) { animation-delay: .02s; }
.dash-grid > :nth-child(2) { animation-delay: .09s; }
.dash-grid > :nth-child(3) { animation-delay: .16s; }
.dash-grid > :nth-child(4) { animation-delay: .23s; }
.dash-grid > :nth-child(5) { animation-delay: .30s; }
.dash-grid > :nth-child(6) { animation-delay: .37s; }

/* Ambient grain — subtle texture/depth over the page background */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* App-nav responsiveness */
@media (max-width: 720px) {
  .nav-left { gap: 1rem; }
  .email-sm { display: none; }
}
@media (max-width: 560px) {
  .app-nav .account-badge { display: none; }
  .nav-links { gap: 0; }
  .nav-link { padding: .4rem .55rem; font-size: .82rem; }
}
