/*
 * Outside Access — dark-theme layer for the sponsor account/auth/checkout views.
 * The visual system (tokens, topbar, .btn, .card, .section, .faq, footer) lives in
 * /asl-design-system.css, shared with autosecurelogin.com. This file only restyles the
 * legacy component classes those forms still use, in the same dark palette and tokens.
 */

main.narrow,
main.auth-page,
main.account-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
main.narrow { max-width: 720px; }
main.auth-page { max-width: 520px; }

.back-link,
.account-back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--ice); }
.account-back { margin-top: 2rem; }

h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.1; margin: .3rem 0 .6rem; letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin: 0 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }

/* .badge, .button, .button.primary/.secondary, .notice base, and .eyebrow all
   come from /asl-design-system.css — we don't redefine them here. */

/* ---------- Forms ---------- */
form label,
.auth-form label,
.checkout-form label {
  display: block;
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--text);
  font-size: .92rem;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input:not([type]), select, textarea {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .7rem .85rem;
  background: var(--obsidian);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(76,154,255, .18);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius, 12px);
  padding: 1.2rem;
  margin: 0 0 1.4rem;
  background: rgba(9, 17, 27, .5);
}
legend { padding: 0 .5rem; font-weight: 700; color: var(--ice); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }

.two-column { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.1rem; }

/* ---------- Buttons ---------- */
/* .button and its .primary/.secondary variants come from the design system.
   We add cursor + disabled affordances and the text-button style it lacks. */
button.button { cursor: pointer; font: inherit; }
.button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.text-button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: .4rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--ice); }
.text-button.danger { color: var(--red); }

/* ---------- Notices (base .notice from design system; add color + error) ---------- */
.notice { border-style: solid; border-left: 3px solid var(--cyan); background: rgba(76,154,255, .06); color: var(--text); margin: 1.2rem 0; }
.notice.error { border-left-color: var(--red); background: rgba(255, 107, 107, .07); }
.notice h2 { color: var(--text); margin: 0 0 .3rem; }

.fine-print { color: var(--dim); font-size: .82rem; margin-top: 1rem; }

/* ---------- Account page ---------- */
.account-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 1.6rem;
  margin-bottom: 1.6rem;
}
.account-header .price { font-size: 1rem; color: var(--muted); margin: .6rem 0; }
.account-header .price strong { font-size: 2rem; color: var(--green); margin-right: .4rem; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg, 16px);
  padding: 1.6rem;
  background: rgba(9, 17, 27, .5);
  margin-bottom: 1.6rem;
}

.resident-list { display: grid; gap: 1.2rem; }
.resident-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  padding: 1.4rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.resident-card.add-resident { margin-top: 1.6rem; background: rgba(12, 22, 34, .5); }
.resident-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.resident-heading p { margin: .2rem 0; color: var(--muted); }
.resident-heading strong { color: var(--text); }
.resident-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin-top: 1.1rem; }
.resident-actions form { display: flex; gap: .5rem; align-items: flex-end; }
.resident-actions label { margin: 0; }

.status-pill {
  display: inline-block; padding: .28rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  border: 1px solid var(--line); color: var(--muted); text-transform: capitalize;
}
.status-active { color: var(--green); border-color: rgba(108, 229, 177, .4); background: rgba(108, 229, 177, .08); }
.status-pending, .status-suspended { color: var(--amber); border-color: rgba(240, 189, 90, .4); background: rgba(240, 189, 90, .08); }

.allowance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; margin-top: .8rem; }
.allowance-grid > div {
  border: 1px solid var(--line-soft); border-radius: var(--radius, 12px);
  padding: .8rem; text-align: center; background: rgba(9, 17, 27, .5);
}
.allowance-grid strong { display: block; font-size: 1.5rem; color: var(--ice); }
.allowance-grid span { font-size: .78rem; color: var(--muted); }

.subscription-details { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1rem 0; }
.subscription-details dt { color: var(--muted); font-size: .8rem; }
.subscription-details dd { margin: 0; font-weight: 700; }

/* ---------- Checkout / plan options ---------- */
.plan-options { display: grid; gap: .8rem; }
.plan-options label {
  display: flex; gap: .8rem; align-items: center; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius, 12px);
  padding: 1rem 1.1rem; background: rgba(9, 17, 27, .5); cursor: pointer;
}
.plan-options label:hover { border-color: var(--cyan); }
.plan-options input { width: auto; margin: 0; }
.plan-options span { display: flex; flex-direction: column; }
.plan-options small { color: var(--muted); font-weight: 400; }
.checkbox { display: flex; gap: .7rem; align-items: flex-start; }
.checkbox input { width: auto; margin-top: .25rem; }

/* ---------- Account-activation notice (sign-in page) ---------- */
/* Deliberately larger than body copy and placed above everything else on the page. The
   heading offers "Create Account" but there is no sign-up form — an account is created by
   a completed Stripe checkout — so this has to be read before the form, not after it. It
   replaces the .fine-print line that used to sit at the bottom, where it was 0.82rem and
   below the fold on a phone. */
.account-notice { margin: 0 0 1.75rem; border-left-width: 4px; }
.account-notice p {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.45;
  font-weight: 650;
  color: var(--text);
}
.account-notice .asterisk {
  color: var(--cyan);
  font-weight: 900;
  margin-right: .2rem;
}
.account-notice a { color: var(--ice); text-decoration: underline; text-underline-offset: 3px; }
.account-notice a:hover { color: var(--text); }
@media (max-width: 480px) {
  .account-notice p { font-size: 1.2rem; }
}

/* ---------- Sign-in page branding ---------- */
/* A sign-in page is where someone is asked to type a password, so it has to be obviously
   ours before they do. The lockup uses the same mark and the same .brand class as the rest
   of the platform rather than a one-off, so the page cannot drift away from the others. */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 520px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}
.auth-topbar .brand { color: var(--text); text-decoration: none; }
.auth-topbar .brand:hover b { color: var(--cyan); }
.auth-topbar-back {
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
}
.auth-topbar-back:hover { color: var(--ice); }

/* The page already has its own top padding; with a header above it that reads as a gap. */
main.auth-page { padding-top: 1.5rem; }

.auth-foot {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  color: var(--dim);
  font-size: .86rem;
}
.auth-foot p { margin: 0 0 .4rem; }
.auth-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.auth-foot a:hover { color: var(--ice); }
.auth-foot-links { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 480px) {
  .auth-topbar { padding-top: 1.1rem; }
  .auth-topbar-back { font-size: .82rem; }
}
