/* =====================================================================
   Metro Trains - CrushFTP login page (v2)
   Left:  Metro staff sign in (SSO)       Right: partners and other accounts
   Stored in prefs.XML <login_page_custom_css> (and the DMZ prefs file)
   ===================================================================== */

:root {
  --metro-blue: #0063be;          /* headings, as on the original page */
  --accent: #F5B451;              /* CrushFTP orange used for the original buttons */
  --accent-dark: #e9a032;
  --accent-tint: #fef5e7;
  --page-bg: #ffffff;
  --text-main: #1f2933;
  --text-muted: #5b6672;
  --line: #d7dde4;
}

/* Page background */
body.login-page,
body.login-page #login {
  background: var(--page-bg) !important;
}

/* The card */
#authFormContainer {
  max-width: 1000px !important;
  width: 100% !important;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

/* Site title across the top of the card */
#authFormContainer::before {
  content: "Secure File Transfer Portal";
  display: block;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--metro-blue);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
}

/* Two halves: tinted staff side, white partner side, divider in between */
#loginFormCard:not(.is-hidden) {
  display: grid !important;
  grid-template-columns: 1fr 64px 1fr;
  grid-template-areas:
    "logo  divider form"
    "staff divider form";
  align-items: center;
  background: #ffffff;
  padding: 3rem 2.5rem;
  min-height: 440px;
}

/* ---------- Left: Metro staff ---------- */
#loginFormCard > div:first-child {
  grid-area: logo;
  align-self: end;
  margin-bottom: 2rem !important;
}

#loginFormCard > div:first-child img.logo {
  max-width: 320px;
  width: 100%;
  height: auto;
}

#crushAuthContainer {
  grid-area: staff;
  align-self: start;
  margin-top: 0 !important;
  align-items: center;
  text-align: center;
}

#crushAuthContainer::before {
  content: "Staff Members";
  order: -2;
  display: block;
  color: var(--metro-blue);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

#crushAuthContainer .continue-label {
  display: none !important;
}

#crushAuthContainer [id^="oidcSigninButton_"] {
  width: 100%;
  max-width: 320px;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--accent) !important;
  color: var(--text-main) !important;
  font-size: 16px !important;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 180, 81, 0.35);
  transition: background 0.15s ease;
}

#crushAuthContainer [id^="oidcSigninButton_"]:hover {
  background: var(--accent-dark) !important;
}

/* ---------- Right: partners and other accounts ---------- */
#loginForm {
  grid-area: form;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 360px;
  justify-self: center;
}

#loginForm::before {
  content: "Partners and Other Accounts";
  order: -2;
  display: block;
  color: var(--metro-blue);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.35rem;
}

#loginForm::after {
  content: "Use the username and password provided to you.";
  order: -1;
  display: block;
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  margin-bottom: 1.5rem;
}

#loginForm label {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
}

#loginForm .input {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
}

#loginForm .input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(245, 180, 81, 0.25) !important;
}

#passwordRow .content-line {
  display: none !important;
}

#forgotLink {
  color: var(--accent-dark) !important;
}

/* Partners Sign in button: same style as the staff button */
#sign-in-button {
  background: var(--accent) !important;
  color: var(--text-main) !important;
  border: 0 !important;
  border-radius: 8px !important;
  padding: 0.85rem 1rem !important;
  font-size: 16px !important;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(245, 180, 81, 0.35);
  transition: background 0.15s ease;
}

#sign-in-button:hover {
  background: var(--accent-dark) !important;
}

/* ---------- Divider with OR badge ---------- */
#loginFormCard:not(.is-hidden)::before {
  content: "";
  grid-area: divider;
  justify-self: center;
  align-self: stretch;
  width: 1px;
  background: var(--line);
}

#loginFormCard:not(.is-hidden)::after {
  content: "OR";
  grid-area: divider;
  justify-self: center;
  align-self: center;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  line-height: 1;
  padding: 0.2em 0 0; /* nudges capitals down to the true centre; adjust if needed */
  border: 1px solid #c3cad3;
  border-radius: 50%;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  z-index: 1;
}

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 820px) {
  #loginFormCard:not(.is-hidden) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "staff"
      "divider"
      "form";
    row-gap: 1.25rem;
    padding: 2rem 1.25rem;
    background: #ffffff;
    min-height: 0;
  }

  #loginFormCard > div:first-child {
    margin-bottom: 0.5rem !important;
  }

  #loginFormCard > div:first-child img.logo {
    max-width: 260px;
  }

  #loginFormCard:not(.is-hidden)::before {
    width: 100%;
    height: 1px;
    align-self: center;
  }

  #loginFormCard:not(.is-hidden)::after {
    width: 44px;
    height: 44px;
  }
}

/* ---------- Compact phone layout: fit on one screen ---------- */
@media (max-width: 820px) {
  body.login-page #login,
  body.login-page .auth-form-section {
    padding: 0 !important;
  }

  #authFormContainer {
    max-width: 100% !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Smaller site title */
  #authFormContainer::before {
    padding: 0.6rem 1rem;
    font-size: 15px;
  }

  #loginFormCard:not(.is-hidden) {
    padding: 1rem 1.25rem 1.25rem;
    row-gap: 0.6rem;
  }

  #loginFormCard > div:first-child {
    margin-bottom: 0 !important;
  }

  #loginFormCard > div:first-child img.logo {
    max-width: 180px;
  }

  /* Staff */
  #crushAuthContainer::before {
    font-size: 19px;
    margin-bottom: 0.6rem;
  }

  #crushAuthContainer [id^="oidcSigninButton_"],
  #sign-in-button {
    padding: 0.7rem 1rem !important;
  }

  #crushAuthContainer [id^="oidcSigninButton_"] {
    max-width: 100%;   /* same width as the Sign in button on phones */
  }

  /* Smaller OR divider */
  #loginFormCard:not(.is-hidden)::after {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  /* Partners */
  #loginForm::before {
    font-size: 19px;
    margin-bottom: 0.25rem;
  }

  #loginForm::after {
    font-size: 14px;
    margin-bottom: 0.75rem;
  }

  /* Hide the field labels visually (placeholders remain, screen readers still read them) */
  #usernameRow label,
  #passwordRow label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  #usernameRow,
  #passwordRow {
    margin-bottom: 0.6rem !important;
  }

  #usernameRow .control,
  #passwordRow .control {
    margin-top: 0 !important;
  }

  #loginForm .input {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
  }

  /* Move "Forgot your password?" below the Sign in button */
  #loginForm > div:has(#forgotPasswordRow) {
    order: 1;
    justify-content: center !important;
    margin: 0.6rem 0 0 !important;
  }

  #forgotLink {
    font-size: 13px !important;
  }
}