:root {
  --cb-bg: #f3f6f8;
  --cb-surface: #ffffff;
  --cb-text: #1e3344;
  --cb-muted: #607687;
  --cb-line: #d2dce4;
  --cb-accent: #0b64b4;
  --cb-accent-dark: #07579e;
  --cb-accent-soft: #eef6fc;
  --cb-bad: #a4312f;
  --cb-bad-soft: #fcebea;
  --cb-good: #12685f;
  --cb-good-soft: #eaf6ee;
  --cb-shadow: 0 12px 34px rgba(20, 43, 59, .10);
  --cb-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cb-bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--cb-text);
  background:
    radial-gradient(circle at 9% 12%, rgba(11, 100, 180, .10), transparent 27rem),
    radial-gradient(circle at 92% 88%, rgba(18, 104, 95, .07), transparent 26rem),
    var(--cb-bg);
  font-family: var(--cb-font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }

.portal-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
  gap: clamp(44px, 8vw, 100px);
  align-items: center;
  padding: 54px 0;
}

.portal-intro { display: flex; flex-direction: column; align-self: stretch; justify-content: center; }
.cb-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--cb-accent);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -.01em;
}
/* Same visual mark used by the CharlieBud app. */
.cb-brand-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--cb-accent);
  font-size: 11px;
  font-weight: 900;
  border-radius: 3px;
  line-height: 1;
}

.intro-copy { max-width: 640px; margin-top: clamp(70px, 12vh, 120px); }
.eyebrow {
  margin: 0 0 14px;
  color: var(--cb-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
}
h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(38px, 5.3vw, 64px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 720;
}
.lede {
  max-width: 610px;
  margin: 24px 0 0;
  color: #516a7c;
  font-size: 18px;
  line-height: 1.65;
}
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}
.feature-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(11, 100, 180, .14);
  border-radius: 999px;
  color: #42647d;
  background: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 700;
}

.login-column { width: 100%; max-width: 440px; justify-self: end; }
.login-card {
  padding: 28px;
  border: 1px solid rgba(174, 191, 205, .72);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--cb-shadow);
}
.login-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}
.login-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  font-size: 17px;
  border-radius: 6px;
}
.login-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.025em;
}
.login-heading p {
  margin: 4px 0 0;
  color: var(--cb-muted);
  font-size: 14px;
}
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { color: #405a6d; font-size: 13px; font-weight: 700; }
.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #b9c8d3;
  border-radius: 9px;
  outline: 0;
  color: var(--cb-text);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: #93a3af; }
.field input:focus {
  border-color: #6d9ec3;
  box-shadow: 0 0 0 3px rgba(11, 100, 180, .14);
}
.login-message {
  display: none;
  margin: 0 0 15px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.login-message.error { display: block; color: #842c2a; background: var(--cb-bad-soft); border: 1px solid #efc5c3; }
.login-message.info { display: block; color: #235877; background: var(--cb-accent-soft); border: 1px solid #cfe3f2; }
.login-message.success { display: block; color: var(--cb-good); background: var(--cb-good-soft); border: 1px solid #cde7d6; }
.primary-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--cb-accent);
  border-radius: 9px;
  color: #fff;
  background: var(--cb-accent);
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .08s ease, opacity .15s ease;
}
.primary-button:hover { background: var(--cb-accent-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.login-foot {
  margin: 17px 0 0;
  color: var(--cb-muted);
  font-size: 12px;
  text-align: center;
}
.portal-note {
  margin: 14px 8px 0;
  color: #7a8d9b;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 860px) {
  .portal-shell {
    width: min(620px, calc(100% - 32px));
    grid-template-columns: 1fr;
    gap: 38px;
    align-content: center;
    padding: 34px 0 46px;
  }
  .portal-intro { align-self: auto; }
  .intro-copy { margin-top: 44px; }
  h1 { font-size: clamp(36px, 10vw, 54px); }
  .lede { font-size: 16px; }
  .login-column { max-width: none; justify-self: stretch; }
}

@media (max-width: 500px) {
  .portal-shell { width: min(100% - 24px, 620px); padding-top: 22px; }
  .intro-copy { margin-top: 36px; }
  .feature-row { margin-top: 26px; }
  .login-card { padding: 22px 18px; border-radius: 11px; }
  .portal-note { margin-inline: 3px; }
}

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