/* Shared login/signup dialog (static/js/login-modal.js).
   Self-contained: no Tailwind or page stylesheet required, so the chat app
   renders the exact dialog the marketing site shows for "Get API key".
   Brand tokens mirror .brand-app in install-first.css. */

.brand-login-backdrop {
  --app-bg: #081008;
  --app-panel: #0c180d;
  --app-panel-2: #102012;
  --app-line: #315f35;
  --app-green: #70db79;
  --app-amber: #e0aa39;
  --app-text: #d7ddc8;
  --app-copy: #aebbaa;
  --app-muted: #829184;

  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--app-text);
  background:
    radial-gradient(circle at 58% 0%, #17351b 0, transparent 30%),
    linear-gradient(#35603818 1px, transparent 1px),
    linear-gradient(90deg, #35603818 1px, transparent 1px),
    var(--app-bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
  background-attachment: fixed;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.brand-login-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  animation: brand-fade-in 0.5s ease-out forwards;
}

.brand-login {
  width: min(460px, 100%);
  position: relative;
  overflow: hidden;
  border: 2px solid #70db79;
  border-radius: 8px;
  background: #060c07;
  box-shadow: 0 0 0 6px #70db7910, 0 28px 80px #000a;
  animation: brand-modal-in 0.2s ease-out forwards;
}
.brand-login-bar {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #315f35;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #102012;
  color: #6f8e72;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-login-dot { width: 9px; height: 9px; border-radius: 50%; background: #6f3734; }
.brand-login-dot:nth-child(2) { background: #9c792b; }
.brand-login-dot:nth-child(3) { background: #3b8142; }
.brand-login-bar-label { margin-left: 7px; }
.brand-login-close { margin-left: auto; padding: 6px; color: #829184; }
.brand-login-close:hover { color: #e0aa39; }
.brand-login-body { padding: 28px; }
.brand-login-mark { display: flex; justify-content: center; margin-bottom: 18px; }
.brand-login-title { margin: 0; color: #d7ddc8; font-size: 26px; font-weight: 700; line-height: 1.08; letter-spacing: -.035em; text-align: center; }
.brand-login-copy { max-width: 340px; margin: 10px auto 24px; color: #829184; font-size: 13px; text-align: center; }
.brand-login-label { display: grid; gap: 7px; color: #aebbaa; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.brand-login-input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #315f35; background: #0c180d; color: #d7ddc8; font-size: 14px; outline: none; }
.brand-login-input:focus { border-color: #70db79 !important; box-shadow: 0 0 0 3px #70db7912; }
.brand-login-code { text-align: center; font-size: 24px; letter-spacing: .4em; color: #70db79; }
.brand-login-divider { margin: 24px 0; display: flex; align-items: center; gap: 12px; color: #526b55; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.brand-login-divider::before, .brand-login-divider::after { content: ""; height: 1px; flex: 1; background: #315f35; }
.brand-login-google { width: 100%; min-height: 46px; border: 1px solid #436847; display: flex; align-items: center; justify-content: center; gap: 10px; background: transparent; color: #aebbaa; }
.brand-login-google:hover { border-color: #70db79; color: #d7ddc8; background: #70db7908; }
.brand-login-google svg { width: 16px; height: 16px; }
.brand-login-switch { margin: 22px 0 0; color: #829184; font-size: 13px; text-align: center; }
.brand-login-switch button { margin-left: 4px; color: #e0aa39; }
.brand-login-switch button:hover { text-decoration: underline; }

.brand-login-form { display: grid; gap: 16px; }
.brand-login-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(112, 219, 121, 0.3);
  background: rgba(112, 219, 121, 0.1);
  color: #70db79;
  font-size: 14px;
}
.brand-login-note svg { width: 16px; height: 16px; flex-shrink: 0; }
.brand-login-error {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  font-size: 14px;
}
.brand-login-submit {
  width: 100%;
  min-height: 46px;
  padding-inline: 16px;
  border: 1px solid #e0aa39;
  background: #e0aa39;
  color: #081008;
  font-size: 14px;
  font-weight: 600;
}
.brand-login-submit:hover { box-shadow: 4px 4px 0 #70db79; }
.brand-login-submit:focus-visible { outline: 2px solid #e0aa39; outline-offset: 2px; }
.brand-login-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.brand-login-links { display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 14px; }
.brand-login-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.brand-login-link:hover { text-decoration: underline; }
.brand-login-link-amber { color: #e0aa39; }
.brand-login-link-amber:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
.brand-login-link-muted { color: #71717a; }
.brand-login-terms {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding-block: 8px;
  color: #aebbaa;
  font-size: 12px;
  line-height: 1.625;
  cursor: pointer;
}
.brand-login-terms input {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: #70db79;
}
.brand-login-terms input:focus-visible { outline: 2px solid #e0aa39; outline-offset: 4px; }
.brand-login-terms a, .brand-login-footnote a { color: #70db79; text-decoration: underline; }
.brand-login-footnote { margin-top: 12px; color: #aebbaa; font-size: 12px; line-height: 1.625; }

@keyframes brand-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes brand-modal-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .brand-login-scrim, .brand-login { animation: none; }
}

@media (max-width: 767px) {
  .brand-login-backdrop button { min-height: 44px; min-width: 44px; }
  .brand-login-backdrop input:not([type="checkbox"]):not([type="radio"]) { font-size: 16px; }
  .brand-login-body { padding: 20px; }
}
