/* Shared by the public pages -- landing, login, register, password reset,
   OTP, the error pages. The navbar, the wordmark and the buttons, so a
   visitor sees the same header on every page before the dashboard and the
   same one inside it. Colours are brand.css tokens only. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand-ring);
  outline-offset: 2px;
}

/* ---- navbar: white, bordered, sticky -- the dashboard sidebar's header
   turned sideways. Sticky rather than fixed so nothing has to reserve
   space for it; the register page used to sit half under it. ---- */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.logo h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* The wordmark: "Gallant" in ink, "SMS" in the logo's orange. The mark's
   colour is reserved for the brand speaking -- here, the sidebar's active
   marker and the rules under section headings -- never for controls, so it
   cannot be mistaken for a warning or a button. */
.gallant,
.login-gallant {
  color: var(--ink);
}

.sms,
.login-sms {
  color: var(--mark);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.nav-quiet {
  color: var(--ink-3);
  font-size: 0.95rem;
}

.hamburger-menu {
  display: none;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- buttons: the dashboard's .action-button ---- */
.action-button,
.nav-links a.action-button {
  background: var(--brand-fill);
  color: #fff;
  border: 1px solid transparent;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-block;
}

.action-button:hover,
.nav-links a.action-button:hover {
  background: var(--brand-fill-hover);
  color: #fff;
}

.signup-button,
.nav-links a.signup-button {
  background: var(--brand-fill);
}

.action-button-ghost,
.nav-links a.action-button-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.action-button-ghost:hover,
.nav-links a.action-button-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* ---- forms ---- */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 0.4rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}

.form-input:focus {
  border-color: var(--brand-ring);
  outline: 3px solid var(--brand-soft);
  outline-offset: 0;
}

.key-help {
  color: var(--ink-3);
  font-size: 0.85rem;
}

/* ---- flash messages (partials/message.ejs) ---- */
.alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  margin: 0.75rem 0 0;
  text-align: left;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--ok-soft);
  color: var(--ok);
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-info {
  background: var(--info-soft);
  color: var(--info);
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger-menu {
    display: block;
  }
}
