/* Portal sign-in. Separate from the workspace sheet so the form grid stays intact. */
:root {
  --auth-navy: #102d3d;
  --auth-navy-deep: #0c2431;
  --auth-teal: #0d625c;
  --auth-lime: #daf4ad;
  --auth-bg: #f3f6f7;
  --auth-ink: #16303c;
  --auth-muted: #4a616b;
  --auth-line: #d5e1e5;
  --auth-white: #fff;
  --auth-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-font-sans-serif: var(--auth-font);
  --bs-body-font-family: var(--auth-font);
}

*, *::before, *::after { box-sizing: border-box; }

body.auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: var(--auth-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.auth-body h1,
body.auth-body h2,
body.auth-body p { margin-top: 0; }

body.auth-body a { color: var(--auth-teal); text-decoration: none; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-aside {
  padding: 1rem 1.15rem 1.2rem;
  background:
    radial-gradient(ellipse 90% 80% at 0% 0%, rgba(218, 244, 173, 0.16), transparent 58%),
    var(--auth-navy);
  color: #fff;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
}

body.auth-body a.auth-brand,
body.auth-body a.auth-brand:hover { color: #fff; }

.auth-brand small {
  display: block;
  margin-top: 1px;
  color: #9eb8c0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--auth-lime);
  color: var(--auth-navy);
  display: grid;
  place-items: center;
  flex: none;
}

.auth-wordmark {
  height: 40px;
  width: auto;
  max-width: 180px;
  background: #fff;
  padding: 3px 8px;
  object-fit: contain;
}

.auth-kicker {
  margin: 0.85rem 0 0.35rem;
  color: var(--auth-lime);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-aside h1 {
  max-width: 16ch;
  margin-bottom: 0;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.auth-aside-copy,
.auth-points { display: none; }

.auth-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 1rem 0.85rem 1.5rem;
}

.auth-card {
  width: min(100%, 440px);
  height: fit-content;
  padding: 1.15rem 1.05rem 0.85rem;
  background: var(--auth-white);
  border: 1px solid var(--auth-line);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(16, 45, 61, 0.08);
}

.auth-role {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 0.55rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #e7eef2;
  color: var(--auth-navy);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-role.is-admin { background: #e7eef2; color: var(--auth-navy); }
.auth-role.is-staff,
.auth-role.is-scanoperator { background: #e7f5f1; color: var(--auth-teal); }
.auth-role.is-accountant { background: #e5f6ea; color: #1d6b45; }
.auth-role.is-owner { background: #fff4dc; color: #8a5608; }

.auth-card h2 {
  margin-bottom: 0.3rem;
  color: var(--auth-navy);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-sub {
  margin-bottom: 1.05rem;
  color: var(--auth-muted);
  font-size: 0.95rem;
}

.auth-alert {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.8rem;
  background: #fff0f1;
  border: 1px solid #f0c9ce;
  border-radius: 12px;
  color: #8d3140;
  font-size: 0.92rem;
}

.auth-alert i { margin-top: 0.1rem; }
.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 0.2rem; }

.auth-field { margin-bottom: 0.85rem; }

.auth-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--auth-navy);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-body .form-control {
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  border: 1px solid #c9d7dc;
  border-radius: 12px;
  background: #fff;
  color: var(--auth-ink);
  font-size: 16px;
  box-shadow: none;
}

.auth-body .form-control:focus {
  border-color: var(--auth-teal);
  box-shadow: 0 0 0 3px rgba(13, 98, 92, 0.16);
}

.auth-body .form-control.is-invalid {
  border-color: #c45b68;
  background: #fffafa;
}

.auth-hint {
  margin-top: 0.35rem;
  color: var(--auth-muted);
  font-size: 0.82rem;
}

.auth-password { position: relative; }

.auth-password .form-control { padding-right: 3.1rem; }

.auth-reveal {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--auth-muted);
}

.auth-reveal:hover { color: var(--auth-navy); background: #f3f7f7; }

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  margin: 0.15rem 0 0.9rem;
}

.auth-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--auth-teal);
  flex: none;
}

.auth-check label {
  color: var(--auth-ink);
  font-size: 0.95rem;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--auth-teal);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
}

.auth-submit:hover { background: #094e49; }

.auth-back {
  margin: 0.85rem 0 0;
  text-align: center;
}

.auth-back a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  font-weight: 700;
}

.auth-switch {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--auth-line);
}

/* Prototype “Experience the workflow as” panels on auth */
.auth-switch .workspace-label {
  color: var(--auth-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.auth-switch .role-tabs {
  display: grid;
  gap: 5px;
}
.auth-switch .role-btn {
  padding: 10px 11px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: var(--auth-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 550;
  min-height: 42px;
}
.auth-switch .role-btn i {
  font-size: 1rem;
  width: 1.1rem;
  text-align: center;
  flex: none;
}
.auth-switch .role-btn:hover {
  background: #f4faf8;
  color: var(--auth-navy);
}
.auth-admin-link {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
}
.auth-admin-link a {
  color: var(--auth-muted);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid #7dcea8;
  outline-offset: 2px;
}

@media (min-width: 576px) {
  .auth-card { padding: 1.45rem 1.4rem 1rem; }
}

@media (min-width: 992px) {
  .auth-shell { flex-direction: row; align-items: stretch; }

  .auth-aside {
    width: min(46vw, 560px);
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 1.75rem 2.25rem 1.5rem;
  }

  .auth-aside-body { margin: auto 0; }

  .auth-kicker { margin-top: 0; }

  .auth-aside h1 {
    max-width: 12ch;
    font-size: clamp(2.1rem, 3vw, 2.85rem);
  }

  .auth-aside-copy {
    display: block;
    max-width: 34ch;
    margin: 0.9rem 0 0;
    color: #c5d7dc;
    font-size: 1.02rem;
  }

  .auth-points {
    display: grid;
    gap: 0.55rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
  }

  .auth-points li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #e7f1f3;
    font-size: 0.92rem;
  }

  .auth-points i { color: var(--auth-lime); }

  .auth-main {
    align-items: center;
    padding: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit, .auth-reveal { transition: none; }
}
