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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #0a1628;
  color: #e0e6ed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo img {
  max-width: 200px;
  height: auto;
  /* border-radius: 3px; */
}

.auth-logo h1 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #8899aa;
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
}

.auth-card {
  background-color: #111f36;
  border: 1px solid #1e3050;
  border-radius: 8px;
  padding: 2rem;
}

.auth-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #8899aa;
  margin-bottom: 0.4rem;
}

/* Says a field may be skipped, rather than leaving someone to guess and then
   be told by the server that it was required after all. */
.field-optional {
  color: #556677;
  font-size: 0.78rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: #0a1628;
  border: 1px solid #1e3050;
  border-radius: 4px;
  color: #e0e6ed;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group select option {
  background-color: #0a1628;
  color: #e0e6ed;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0a1628 inset;
  -webkit-text-fill-color: #e0e6ed;
  border: 1px solid #1e3050;
  transition: background-color 5000s ease-in-out 0s;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
}

.toggle-password img {
  width: 20px;
  height: 20px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.toggle-password:hover img {
  opacity: 0.8;
}

.btn-primary {
  width: 100%;
  padding: 0.7rem;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
}

.auth-links a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.85rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Four links and three separators do not fit one line in a 400px card, and
   wrapping left a dangling "|" opening the second row. The legal pair gets its
   own quieter row instead — they are reference links, not next steps. */
.auth-links-legal {
  margin-top: 0.5rem;
}

.auth-links-legal a {
  color: #7d96b5;
  font-size: 0.78rem;
}

.error-message {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.success-message {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

/* Password requirements */
.password-requirements {
  list-style: none;
  margin: 0.5rem 0 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: #8899aa;
}

.password-requirements li {
  padding: 0.15rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.password-requirements li::before {
  content: '○';
  position: absolute;
  left: 0;
}

.password-requirements li.met {
  color: #4ade80;
}

.password-requirements li.met::before {
  content: '●';
}

/* Terms of Service - checkbox agreement */
.tos-agree {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  margin-top: 0.25rem;
}

.tos-agree input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background-color: #0a1628;
  border: 1px solid #1e3050;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background-color 0.2s;
}

.tos-agree input[type="checkbox"]:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.tos-agree input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tos-agree label {
  font-size: 0.82rem;
  color: #8899aa;
  cursor: pointer;
}

.tos-agree label a {
  color: #3b82f6;
  text-decoration: none;
}

.tos-agree label a:hover {
  text-decoration: underline;
}

/* Terms of Service - full page */
.terms-page {
  max-width: 600px;
}

.tos-full {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #b0bec5;
}

.tos-full h3 {
  color: #e0e6ed;
  font-size: 0.95rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.tos-full p {
  margin-bottom: 0.6rem;
}

/* Links inside the legal body had no rule, so they fell back to the browser's
   default dark blue — effectively invisible on this card. Underlined as well as
   coloured, because these are references a reader is meant to follow. */
.tos-full a {
  color: #60a5fa;
  text-decoration: underline;
}

.tos-full a:hover {
  color: #93c5fd;
}

.tos-full ul {
  margin: 0 0 0.6rem 1.4rem;
  padding: 0;
}

.tos-full li {
  margin-bottom: 0.3rem;
}


/* ---------------------------------------------------------------------------
   Legal pages — light, to match the marketing site.

   The Terms and the Privacy Policy are public documents. They are reached from
   two places with opposite palettes: the ibexaero.com footer, which is white
   and set in Inter, and the login and access-request screens, which are dark.
   One of those transitions was always going to be a jump, so the question is
   which one a reader forgives.

   Coming off the marketing site into a dark page reads as having landed
   somewhere else — wrong site, or a broken link. Coming off a dark utility
   screen into a light page reads as opening a document, which is what it is.
   So these match the public brand, and the login screens hand off to them.

   Scoped to body.legal-page, so the auth screens sharing this stylesheet are
   untouched. It lives in auth.css rather than a legal.css of its own because
   nginx proxies stylesheets one explicit filename at a time, and a new file
   would 404 in public exactly the way /privacy did.
   --------------------------------------------------------------------------- */
body.legal-page {
  --ink-1: #0f1f33;
  --ink-2: #4b5a6e;
  --ink-3: #8a95a3;
  --rule: #dcd8cc;
  --brand: #1e3a5f;
  --link: #2a5f8f;

  background-color: #ffffff;
  color: var(--ink-1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* A long document starts at the top; only a login card wants centring. */
  align-items: flex-start;
}

body.legal-page .auth-container {
  max-width: 46rem;
  padding: 3rem 2rem 4rem;
}

body.legal-page .auth-logo {
  margin-bottom: 2.5rem;
}

/* The mark alone, as the marketing footer uses it — the wordmark below is
   real text, so repeating it in the image would say it twice. */
body.legal-page .auth-logo img {
  max-width: none;
  height: 52px;
  width: auto;
}

body.legal-page .auth-logo h1 {
  color: var(--ink-2);
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  text-transform: uppercase;
}

/* No card. On white, a bordered panel around a legal document just boxes in
   text that wants to read as a page. */
body.legal-page .auth-card {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

body.legal-page .auth-card h2 {
  color: var(--ink-1);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

body.legal-page .tos-full {
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.75;
}

body.legal-page .tos-full h3 {
  color: var(--ink-1);
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

body.legal-page .tos-full p {
  margin-bottom: 0.9rem;
}

body.legal-page .tos-full ul {
  margin: 0 0 0.9rem 1.5rem;
}

body.legal-page .tos-full li {
  margin-bottom: 0.45rem;
}

body.legal-page .tos-full strong {
  color: var(--ink-1);
  font-weight: 600;
}

body.legal-page .tos-full a,
body.legal-page .auth-links a {
  color: var(--link);
  text-decoration: underline;
}

body.legal-page .tos-full a:hover,
body.legal-page .auth-links a:hover {
  color: var(--brand);
}

body.legal-page .auth-links {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

/* The separators between footer links are inline-styled for the dark pages. */
body.legal-page .auth-links span {
  color: var(--rule) !important;
}

@media (max-width: 600px) {
  body.legal-page .auth-container {
    padding: 2rem 1.25rem 3rem;
  }

  body.legal-page .auth-card h2 {
    font-size: 1.35rem;
  }
}
