/* Halveron OS product shell - brand-matched with audit portal */
:root {
  --ink: #0e0e0e;
  --ember: #ff4301;
  --chalk: #fafaf8;
  --muted: #6b6865;
  --border: rgba(14, 14, 14, 0.12);
  --bg: #ffffff;
  --surface: #f5f4f1;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --ok: #1a7a4c;
  --warn-bg: #fff4ef;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

/* Auth layout (mirrors audit) */
.app-auth {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

@media (min-width: 768px) {
  .app-auth {
    flex-direction: row;
  }
}

.app-auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.app-auth-inner {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-brand {
  font-size: clamp(1.3rem, 1vw + 1rem, 2.25rem);
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.app-brand-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
}

.app-auth h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.app-auth h1 .ember {
  color: var(--ember);
}

.app-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.app-intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--ember);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.app-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.app-glass {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(14, 14, 14, 0.04);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.app-glass:focus-within {
  border-color: rgba(255, 67, 1, 0.7);
  background: rgba(255, 67, 1, 0.05);
}

.app-glass input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-radius: 1rem;
  outline: none;
}

.app-password {
  position: relative;
}

.app-password input {
  padding-right: 3rem;
}

.app-toggle-pass {
  position: absolute;
  inset: 0 0.75rem 0 auto;
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.app-toggle-pass svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.app-toggle-pass svg[hidden],
.app-toggle-pass svg.is-hidden {
  display: none !important;
}

.app-toggle-pass:hover {
  color: var(--ink);
}

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}

.app-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.app-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ember);
}

.app-link {
  color: var(--ember);
  text-decoration: none;
}

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

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.app-btn-primary {
  background: var(--ember);
  color: #fff;
}

.app-btn-primary:hover {
  filter: brightness(1.05);
}

.app-btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.app-btn-ghost:hover {
  background: var(--chalk);
}

.app-btn-sm {
  width: auto;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  border-radius: 0.75rem;
}

.app-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid var(--border);
}

.app-divider span {
  position: relative;
  z-index: 1;
  padding: 0 1rem;
  background: var(--bg);
  font-size: 0.875rem;
  color: var(--muted);
}

.app-switch {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.app-name-field[hidden],
.app-signin-only[hidden] {
  display: none !important;
}

.app-hero {
  display: none;
  flex: 1;
  position: relative;
  padding: 1rem;
}

@media (min-width: 768px) {
  .app-hero {
    display: block;
  }
}

.app-hero-bg {
  position: absolute;
  inset: 1rem;
  border-radius: 1.5rem;
  background-size: cover;
  background-position: center;
}

.app-hero-shade {
  position: absolute;
  inset: 1rem;
  border-radius: 1.5rem;
  background: linear-gradient(to top, rgba(14, 14, 14, 0.8), rgba(14, 14, 14, 0.25), transparent);
  pointer-events: none;
}

.app-hero-copy {
  position: absolute;
  left: 2.5rem;
  right: 2.5rem;
  bottom: 2.5rem;
  color: #fff;
  z-index: 1;
}

.app-hero-copy h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.app-hero-copy p {
  margin: 0;
  opacity: 0.85;
  line-height: 1.5;
  max-width: 28rem;
}

/* Shell pages (onboarding / checkout / home) */
.app-shell {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255, 67, 1, 0.08), transparent 55%),
    linear-gradient(180deg, var(--chalk) 0%, var(--bg) 40%);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-topbar-brand {
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  font-size: 1.15rem;
}

.app-topbar-brand span {
  color: var(--ember);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  margin-left: 0.35rem;
}

.app-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-topbar-email {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

.app-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember);
}

.app-main h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.app-main > .app-lead {
  margin-bottom: 1.75rem;
}

.app-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.app-banner--trial {
  background: var(--warn-bg);
  border: 1px solid rgba(255, 67, 1, 0.25);
  color: var(--ink);
}

.app-banner--paid {
  background: rgba(26, 122, 76, 0.08);
  border: 1px solid rgba(26, 122, 76, 0.25);
  color: var(--ink);
}

.app-banner strong {
  color: var(--ember);
}

.app-banner--paid strong {
  color: var(--ok);
}

.app-panel {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: #fff;
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
}

.app-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.app-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.app-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.app-checklist input {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--ember);
  flex-shrink: 0;
}

.app-checklist label {
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
}

.app-checklist label small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.app-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 520px) {
  .app-actions {
    flex-direction: row;
  }

  .app-actions .app-btn {
    width: auto;
    min-width: 11rem;
  }
}

.app-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.app-summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.app-summary-row span:last-child {
  font-weight: 650;
  text-align: right;
}

.app-billing-toggle {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 1rem 0 0.5rem;
}

.app-billing-toggle button {
  border: 0;
  background: transparent;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
}

.app-billing-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(14, 14, 14, 0.08);
}

.app-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.app-home-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .app-home-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.app-stat {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0;
}

.app-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.app-nav-pills span {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
  background: #fff;
}

.app-nav-pills span.is-active {
  border-color: rgba(255, 67, 1, 0.35);
  color: var(--ember);
  background: var(--warn-bg);
}

@keyframes app-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-animate {
  animation: app-fade-up 0.45s ease both;
}

.app-animate-delay-1 { animation-delay: 0.05s; }
.app-animate-delay-2 { animation-delay: 0.12s; }
.app-animate-delay-3 { animation-delay: 0.2s; }

