/* Roboto – same files as original */
@font-face {
  font-family: "Roboto";
  src: url("roboto-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("roboto-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

html, body {
  height: 100%;
  font-family: "Roboto", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Light mode (default) – matches left side of side-by-side */
:root {
  --card-bg: #ffffff;
  --card-text: #333333;
  --input-text: #333333;
  --input-border: #c5c5c5;
  --input-border-focus: #5a7a9a;
  --input-label: #666666;
  --input-label-float: #5a7a9a;
  --theme: #1a5f8a;
  --footer-bg: #ffffff;
  --footer-text: #555555;
  --footer-link: #1a5f8a;
  --footer-shadow: 0 -1px rgba(0,0,0,0.08);
  --logo-filter: none;
  --btn-primary: #0a3d6b;
  --btn-primary-hover: #0c4a7d;
  --page-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #2c2c2e;
    --card-text: #e8e8e8;
    --input-text: #f0f0f0;
    --input-border: #6a7278;
    --input-border-focus: #23a1b2;
    --input-label: #8c989f;
    --input-label-float: #23a1b2;
    --theme: #23a1b2;
    --footer-bg: #1e1e20;
    --footer-text: rgba(255,255,255,0.55);
    --footer-link: #23a1b2;
    --footer-shadow: 0 -1px rgba(0,0,0,0.1);
    --logo-filter: brightness(0) invert(1);
    --btn-primary: #0a4a7a;
    --btn-primary-hover: #0c5a94;
    --page-bg: #0a0a0a;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--card-text);
}

.background {
  position: fixed;
  inset: 0;
  background-image: url("background.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -1;
}

.login-container {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 8px;
}

/* jha-card from original */
.login-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin: 32px 8px;
  padding: 24px 48px 32px;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.logo-wrapper {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.logo {
  height: 72px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  filter: var(--logo-filter);
  display: block;
}

.login-step { width: 100%; }
.login-step[hidden] { display: none !important; }

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Outlined floating label with border notch (Material style like original) */
.form-group {
  position: relative;
  margin-bottom: 20px;
  width: 100%;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 14px 14px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 400;
  color: var(--input-text);
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:hover {
  border-color: #999;
}

.form-input:focus {
  border-color: var(--input-border-focus);
  box-shadow: none;
}

.form-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 400;
  color: var(--input-label);
  pointer-events: none;
  transition: all 0.15s ease;
  background: var(--card-bg);
  padding: 0 4px;
  line-height: 1;
}

/* Floated label sits on the border (notch) */
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label,
.form-input.has-value + .form-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--input-label-float);
}

.password-group .form-input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--theme);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.toggle-password svg { display: block; }
.toggle-password svg[hidden] { display: none !important; }

/* Locked username row – same outline field look */
.username-box {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  min-height: 48px;
  margin-bottom: 20px;
  padding: 14px 70px 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.username-label {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--input-label-float);
  font-weight: 400;
  background: var(--card-bg);
  padding: 0 4px;
  line-height: 1;
}

.username-value {
  font-size: 16px;
  color: var(--input-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-link {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--theme);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.switch-link:hover {
  text-decoration: underline;
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 28px;
  margin-top: -8px;
}

.forgot-link {
  color: var(--theme);
  font-size: 14px;
  text-decoration: none;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
}

.forgot-link:hover {
  text-decoration: underline;
}

.actions-row,
.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 4px;
}

.enroll-link {
  color: var(--theme);
  font-size: 14px;
  text-decoration: none;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.3;
}

.enroll-link:hover {
  text-decoration: underline;
}

/* Dark navy button matching original light-mode Sign in / Continue */
.primary-btn {
  background-color: var(--btn-primary);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  line-height: 40px;
  height: 40px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
}

.primary-btn:hover {
  background-color: var(--btn-primary-hover);
}

.primary-btn:focus {
  outline: none;
}

.passkey-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--theme);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  line-height: 1.3;
}

.passkey-btn:hover {
  text-decoration: underline;
}

.fingerprint-icon {
  flex-shrink: 0;
  color: var(--theme);
}

.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 12px 20px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--footer-shadow);
  flex-shrink: 0;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.footer-content a {
  color: var(--footer-link);
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

.separator {
  margin: 0 6px;
  color: var(--footer-text);
  opacity: 0.7;
}

.equal-housing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.house-icon {
  flex-shrink: 0;
  color: var(--footer-text);
}

@media (max-width: 480px) {
  .login-card {
    margin: 24px 8px;
    padding: 20px 24px 24px;
  }
  .actions-row,
  .passkey-row {
    flex-direction: column;
    align-items: stretch;
  }
  .primary-btn { width: 100%; }
  .enroll-link,
  .passkey-btn {
    text-align: center;
    justify-content: center;
  }
}
