:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #1f2937;
  background: #eef2f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.card,
.app-shell {
  width: min(100%, 1000px);
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.auth-card {
  max-width: 460px;
  padding: 32px;
}

/* Home: shown while a saved session is restored, or when the connection fails. */
.session-status-card .brand {
  margin-bottom: 18px;
}

.session-status-text {
  margin: 0;
  color: #475569;
}

.session-status-text.error {
  color: #b42318;
}

.session-status-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.session-status-actions .secondary-button {
  width: 100%;
}

/* Cloudflare Turnstile: stays empty unless a visitor must solve a challenge. */
.auth-captcha {
  display: flex;
  justify-content: center;
}

.auth-captcha:has(iframe) {
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand h1,
.topbar h1,
.profile-card h2 {
  margin: 0;
}

.brand p,
.environment-label,
.muted {
  margin: 5px 0 0;
  color: #64748b;
}
.brand-logo {
  width: 100px;
  height: auto;
  display: block;
}


.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #bfcbd8;
  border-radius: 9px;
  outline: none;
  background: #ffffff;
}

.field input:focus {
  border-color: #2467a8;
  box-shadow: 0 0 0 3px rgba(36, 103, 168, 0.15);
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  background: #163b69;
  color: #ffffff;
}

.secondary-button {
  background: #e8edf3;
  color: #1f2937;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.message {
  min-height: 24px;
  margin: 18px 0 0;
}

.message.error {
  color: #b42318;
}

.message.success {
  color: #067647;
}

.app-shell {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5eaf0;
}

.environment-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-card {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 24px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #dce3ea;
  border-radius: 14px;
  background: #f8fafc;
}

.eyebrow {
  margin: 0 0 7px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dcecff;
  color: #174c7e;
  font-size: 0.82rem;
  font-weight: 800;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.module-card {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  border: 1px solid #dce3ea;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2937;
  text-align: left;
}

.module-card:disabled {
  cursor: default;
  opacity: 1;
}

.module-card strong {
  font-size: 1.05rem;
}

.module-card span,
.module-card small {
  color: #64748b;
}

.module-card small {
  margin-top: auto;
  font-weight: 700;
}

@media (max-width: 760px) {
  .page {
    align-items: flex-start;
    padding: 14px;
  }

  .app-shell,
  .auth-card {
    padding: 22px;
  }

  .profile-card,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: center;
  }
}

.brand-logo {
  width: 100px;
  height: auto;
  display: block;
}
/* Authentication links and recovery pages */
.auth-introduction {
  margin: -8px 0 24px;
  color: #64748b;
  line-height: 1.55;
}

.auth-footer {
  margin-top: 22px;
  text-align: center;
}

.auth-link {
  color: #174c7e;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  text-decoration: underline;
}

.auth-state-panel {
  padding: 16px;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  background: #f8fafc;
  line-height: 1.5;
}

.auth-state-panel h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.auth-state-panel p {
  margin: 0 0 16px;
}

.auth-state-error {
  border-color: #f2b8b5;
  background: #fff5f4;
  color: #8f1d17;
}

.auth-state-success {
  border-color: #a6dfc6;
  background: #f1fff8;
  color: #05603a;
}

.button-link {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 16px;
}

.password-input-wrapper {
  display: flex;
  align-items: stretch;
}

.password-input-wrapper input {
  border-radius: 9px 0 0 9px;
}

.password-toggle-button {
  min-width: 72px;
  border: 1px solid #bfcbd8;
  border-left: 0;
  border-radius: 0 9px 9px 0;
  background: #eef2f6;
  color: #1f2937;
  font-weight: 700;
}

.password-toggle-button:hover,
.password-toggle-button:focus-visible {
  background: #dfe7ef;
}

.password-rules {
  margin: -4px 0 18px;
  padding: 14px 16px;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.9rem;
}

.password-rules p {
  margin: 0 0 8px;
  font-weight: 700;
}

.password-rules ul {
  margin: 0;
  padding-left: 20px;
}

.password-rules li {
  margin: 5px 0;
}

.password-rules li.valid {
  color: #067647;
  font-weight: 700;
}

.field > .auth-link {
  display: inline-block;
  margin-top: 10px;
}

.password-input-wrapper input {
  min-width: 0;
  flex: 1 1 auto;
}
