/* Sign-in/sign-up control (js/auth.js) + watchlist star toggle
   (company.html) + "Your Companies" row (index.html). Loaded on every
   page, same as cookie-consent.css. Matches the white-card / 8px-radius /
   var(--color-border)-border language used on company.html's Overview tab. */

/* ===== Header account control ===== */

.auth-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 78px;
  margin-left: auto;
}

.auth-signin-btn {
  background: var(--brand-blue);
  color: var(--color-surface);
  border: none;
  border-radius: 8px;
  padding: 0.5em 1.1em;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.auth-signin-btn:hover {
  background: #0a5bb0;
  box-shadow: 0 2px 10px rgba(14, 109, 209, 0.25);
}

.auth-account {
  position: relative;
}

.auth-account-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: var(--color-surface);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.12);
  padding: 8px;
  z-index: 200;
}

.auth-dropdown.active {
  display: block;
}

.auth-dropdown-email {
  margin: 4px 8px 8px 8px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
}

.auth-dropdown-item:hover {
  background: var(--color-surface-soft);
}

@media (max-width: 768px) {
  .auth-control {
    margin-right: 3.25rem;
  }
}

/* ===== Sign in / sign up modal ===== */

.auth-modal-overlay {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 30, 50, 0.4);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-modal {
  position: relative;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 2em 1.75em 1.75em 1.75em;
  width: 100%;
  max-width: 360px;
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}

.auth-modal-close:hover {
  color: var(--brand-ink);
}

.auth-modal-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 1.4em;
}

.auth-modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 8px 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-modal-tab.active {
  background: var(--color-surface);
  color: var(--brand-ink);
  box-shadow: 0 1px 2px rgba(20, 30, 50, .1);
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-ink);
}

.auth-field input {
  padding: 0.65em 0.8em;
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(14, 109, 209, 0.12);
}

.auth-modal-error {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-negative);
}

.auth-submit-btn {
  background: var(--brand-blue);
  color: var(--color-surface);
  border: none;
  border-radius: 8px;
  padding: 0.7em 0;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit-btn:hover {
  background: #0a5bb0;
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.2em 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-modal-divider::before,
.auth-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-surface-tint);
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.65em 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-google-btn:hover {
  background: var(--color-surface-soft);
  border-color: var(--color-border-soft);
}

/* ===== Watchlist star toggle (company.html) ===== */

.watchlist-star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.watchlist-star-btn:hover {
  border-color: var(--color-border-soft);
  color: var(--color-text-muted);
}

.watchlist-star-btn.is-starred {
  color: #f0a63a;
  border-color: #f0d9ac;
  background: #fdf6ea;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .watchlist-star-btn.is-starred {
    border-color: #6b4f1f;
    background: #2b2214;
  }
}

:root[data-theme="dark"] .watchlist-star-btn.is-starred {
  border-color: #6b4f1f;
  background: #2b2214;
}

