/* Sign-in screen and account box. Uses the shared dark theme from style.css. */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  gap: 12px;
}
.auth-brand { font-size: 1.2rem; font-weight: 700; }
.auth-lead { margin: 0; color: var(--muted); font-size: 0.92rem; }
.auth-card label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.auth-card input {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}
.auth-tabs { display: flex; gap: 6px; }
.auth-tabs button { flex: 1; }
.auth-tabs button.active { border-color: var(--accent); color: var(--accent); }
.auth-error { margin: 0; color: #ff7b7b; font-size: 0.9rem; }
.auth-card > .note { margin: 0; }

.account { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.account[hidden] { display: none; }

/* Header account card: initials, name and workspace, with an icon-only log-out button. */
.account { gap: 10px; color: var(--muted); }
.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.account-text { display: grid; line-height: 1.2; }
.account-text strong { color: #ffffff; font-size: 0.9rem; }
.account-text small { color: var(--muted); font-size: 0.75rem; }
.account-logout {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.account-logout:hover { background: rgba(255, 255, 255, 0.08); }

/* Log in / Register tabs: the inactive tab keeps readable text on a dark background. */
.auth-tabs button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111111;
}

/* Account button in the header: the name and avatar open a small menu. */
.account { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: inherit;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.account-trigger:hover { background: rgba(127, 127, 127, 0.14); }
.account-caret { font-size: 0.7rem; color: var(--muted); }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  z-index: 1100;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.account-menu[hidden] { display: none; }
.account-menu button {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.account-menu button:hover { background: var(--panel-2); }

/* Login and registration: two panels, a dark hero on the left and the form on the right. */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.auth-hero {
  background: linear-gradient(160deg, #13294a, #0b1a33);
  color: #ffffff;
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-hero h1 { margin: 6px 0 4px; font-size: 2.4rem; line-height: 1.12; font-weight: 800; }
.auth-hero-text { margin: 0; color: #cfdcf0; line-height: 1.5; }
.auth-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8fb4ff;
  font-weight: 700;
}
.auth-tiles {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.auth-tile {
  background: #1a3358;
  border: 1px solid #27497a;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.auth-tile img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
}
.auth-tile span { display: block; margin-top: 8px; font-size: 0.85rem; font-weight: 700; color: #ffffff; }
.auth-features {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid #27497a;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: #ffd66b;
}
.auth-panel {
  background: var(--panel);
  color: var(--text);
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-panel h2 { margin: 2px 0 0; font-size: 1.6rem; color: var(--text); }
.auth-panel .auth-eyebrow { color: var(--blue); }
.auth-lead { margin: 0 0 6px; color: var(--muted); }
.auth-panel .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.auth-panel .auth-tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}
.auth-panel .auth-tabs button.active { background: var(--blue); color: #ffffff; }
.auth-panel label { display: grid; gap: 6px; font-size: 0.88rem; color: var(--text); }
.auth-panel label[hidden] { display: none; }
.auth-panel input {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}
.auth-panel input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.auth-error { margin: 0; color: #ff7b7b; font-size: 0.9rem; }
.auth-error[hidden] { display: none; }
.auth-submit {
  margin-top: 6px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #2f7bff, #1d4fd8);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-note { margin: 4px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero h1 { font-size: 1.8rem; }
  .auth-tiles { grid-template-columns: repeat(3, 1fr); }
}

/* Splash image on the sign-in hero, between the description and the picture tiles. */
.auth-splash {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #27497a;
  margin-top: 16px;
}
