/*************************************************************************
 *  Copyright (C) 2026 SecureFlag Limited
 *  All Rights Reserved.
 *
 * NOTICE: All information contained herein is, and remains the property
 * of SecureFlag Limited. The intellectual and technical concepts contained
 * herein are proprietary to SecureFlag Limited and may be covered by EU
 * and Foreign Patents, patents in process, and are protected by trade secret
 * or copyright law. Dissemination of this information or reproduction of this
 * material is strictly forbidden unless prior written permission is obtained
 * from SecureFlag Limited.
 */

/* ------------------------------------------------------------------ *
 * Login page redesign (dark theme).
 * Layered after lib.css / auth.min.css / ostyle.css so it wins on the
 * login page only. Functional element IDs (#username, #password, #mfa,
 * #loginButton, #authTypeButton, #password-group, #mfaDiv, error/flow
 * divs, .waitLoader) are untouched — their default-hidden states still
 * come from auth.min.css and are toggled by login.js.
 * ------------------------------------------------------------------ */

/* ---- Fonts (bundled locally, same-origin so CSP font-src 'self' allows) ----
 * The auth pages don't load header-footer.css, so Inter/Poppins are declared
 * here to match the Figma type ramp (Inter body, Poppins display). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("./fonts/Inter-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("./fonts/Inter-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("./fonts/Poppins-SemiBold.ttf") format("truetype");
}

:root {
  --sfl-blue: #2f6fd6;
  --sfl-blue-hover: #2a63c0;
  --sfl-text: #ffffff;
  --sfl-text-subdued: rgba(255, 255, 255, 0.78);
  --sfl-text-muted: rgba(255, 255, 255, 0.5);
  --sfl-hairline: rgba(255, 255, 255, 0.1);
  --sfl-input-bg-solid: #141414;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #000;
  color: var(--sfl-text);
  font-family: "Inter", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Page shell ---- */
.sfl-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow-x: hidden;
}

/* ---- Header ---- */
.sfl-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.64);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.sfl-logo {
  display: block;
  height: 34px;
  width: auto;
}
.sfl-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--sfl-text);
  cursor: pointer;
  transition: background 150ms ease;
}
.sfl-close:hover {
  background: rgba(255, 255, 255, 0.08);
}
.sfl-close svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* ---- Main / ambient background ---- */
.sfl-main {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0px 16px;
}
.sfl-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}
.sfl-bg__glow {
  position: absolute;
  inset: 0;
  background: url("/assets/img/login-bg.svg") no-repeat center center;
  background-size: contain;
  mix-blend-mode: lighten;
}
.sfl-bg__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 600px;
  background: linear-gradient(to bottom, rgba(1, 1, 1, 0) 0%, #010101 100%);
}
.sfl-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Hero heading ---- */
.sfl-hero {
  text-align: center;
  margin-bottom: 40px;
}
.sfl-title {
  margin: 0 0 16px;
  font-family: "Poppins", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--sfl-text);
  overflow-wrap: break-word;
}
.sfl-title__accent {
  background: linear-gradient(289deg, #8cc8ff 24.57%, #007bff 48.4%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* Fallback: if the browser can't clip the gradient to the text, the accent
 * would render invisible (transparent fill). Paint it a solid blue instead. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .sfl-title__accent {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--sfl-blue);
  }
}
.sfl-subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  color: var(--sfl-text-subdued);
}
.sfl-subtitle a {
  color: var(--sfl-text);
  font-weight: 600;
  text-decoration: underline;
}

/* ---- Form card ---- */
.sfl-card {
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.sfl-card form {
  margin: 0;
}

/* Fields */
.sfl-field {
  margin: 0 0 16px;
}
.sfl-label {
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--sfl-text-subdued);
}
.sfl-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sfl-text);
  font-size: 16px;
  line-height: 24px;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.sfl-input::placeholder {
  color: var(--sfl-text-muted);
}
.sfl-input:focus {
  border-color: var(--sfl-blue);
  background: rgba(255, 255, 255, 0.09);
}
/* Keep autofilled inputs on-theme (WebKit paints an opaque bg we can only
   override with an inset box-shadow; the long transition hides the fade). */
.sfl-input:-webkit-autofill,
.sfl-input:-webkit-autofill:hover,
.sfl-input:-webkit-autofill:focus,
.sfl-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--sfl-text);
  caret-color: var(--sfl-text);
  -webkit-box-shadow: 0 0 0 1000px var(--sfl-input-bg-solid) inset;
  box-shadow: 0 0 0 1000px var(--sfl-input-bg-solid) inset;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 5000s ease-in-out 0s;
}

/* Remember me / forgot password row */
.sfl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 24px;
}
.sfl-link {
  color: var(--sfl-blue);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.sfl-link:hover {
  text-decoration: underline;
}

/* Custom checkbox (reuses auth.min.css .control base, restyled for dark) */
.sfl-check.control {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 0 0 34px;
  min-height: 24px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--sfl-text);
}
.sfl-check .control_indicator {
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.24);
}
.sfl-check.control:hover input:not([disabled]):not(:checked) ~ .control_indicator {
  background: #ffffff;
}
.sfl-check input:checked ~ .control_indicator,
.sfl-check.control:hover input:not([disabled]):checked ~ .control_indicator {
  background: var(--sfl-blue);
  border-color: var(--sfl-blue);
}
.sfl-check.control-checkbox .control_indicator:after {
  left: 9px;
  top: 5px;
  width: 4px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
}

/* Buttons (#authTypeButton visible first, #loginButton after auth-type) */
.sfl-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 16px;
  border: none;
  border-radius: 9999px;
  background: var(--sfl-blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  transition: background 150ms ease;
}
.sfl-btn:hover {
  background: var(--sfl-blue-hover);
}
.sfl-btn + .sfl-btn {
  margin-top: 12px;
}

/* Inline status notes (SSO redirect / checking auth / OAuth return) */
.sfl-note {
  margin-top: 16px;
  color: var(--sfl-text-subdued);
  font-size: 15px;
  line-height: 22px;
  text-align: center;
}

/* Error / alert messages (reuse .alertText from auth.min.css, keep red) */
.sfl-card .alertText {
  margin-top: 16px;
  color: #ff7272;
  font-size: 15px;
  line-height: 20px;
}
.sfl-card .alertText a {
  color: var(--sfl-blue);
}

/* Back-to-SSO link block */
#backToLogin {
  margin-top: 16px;
  padding-bottom: 0;
  text-align: center;
  color: var(--sfl-text-subdued);
  font-size: 15px;
}
#backToLogin hr {
  border: none;
  border-top: 1px solid var(--sfl-hairline);
  margin: 20px 0 16px;
}
#backToLogin a {
  color: var(--sfl-blue);
}

/* Forgot-password link default state (override light-theme rules) */
#resetPassword {
  position: static;
  top: auto;
  display: inline;
}

/* ---- Footer ---- */
.sfl-footer {
  position: relative;
  z-index: 5;
  padding: 40px 24px;
}
.sfl-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.sfl-footer__divider {
  height: 1px;
  background: var(--sfl-hairline);
  margin-bottom: 40px;
}
.sfl-footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--sfl-text-subdued);
}
.sfl-footer__meta span {
  margin: 0;
}

/* ---- Responsive ---- */
@media screen and (max-width: 640px) {
  .sfl-main {
    padding: 56px 16px;
  }
  .sfl-subtitle {
    font-size: 16px;
    line-height: 24px;
  }
  .sfl-hero {
    margin-bottom: 36px;
  }
  .sfl-card {
    padding: 28px 20px;
  }
  .sfl-footer__meta {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ------------------------------------------------------------------ *
 * State pages — one centered card carrying an icon, a heading, a short
 * message and a single action.
 *
 * Used by every status page (400, 404, 500, generic, invalid license,
 * email validation) and by each step of the password-reset flow. It
 * lives here, in the shared base, rather than in one page's stylesheet
 * because all of them need it — it was previously in resetpassword.css,
 * which only resetPassword.html loaded.
 * ------------------------------------------------------------------ */

/* One .sfl-state per step, so an ng-show can swap a whole step at once. */
.sfl-state {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Anchors that act as buttons (Back to homepage / Try again / Log in). */
a.sfl-btn,
a.sfl-btn:hover,
a.sfl-btn:focus {
  text-decoration: none;
  color: #ffffff;
}

.sfl-card--center {
  text-align: center;
}

.sfl-state-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
}

.sfl-state-title {
  margin: 0 0 12px;
  font-family: "Poppins", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sfl-text);
}

.sfl-state-text {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 24px;
  color: var(--sfl-text-subdued);
}

.sfl-state-text a {
  color: var(--sfl-blue);
}

/* A status page has no form, so its card should not stretch to form width. */
.sfl-card--narrow {
  max-width: 480px;
  /* Centres itself, so it still sits mid-page inside a container jQuery has
     switched to display:block (support.js does this when toggling panels). */
  margin-left: auto;
  margin-right: auto;
}

/* ------------------------------------------------------------------ *
 * Loading overlay, dark theme.
 *
 * ostyle.css styles one shared loader for the light screens that also use
 * it — management/index.html and the six user/*.html pages. There it is a
 * white 70% scrim with a white tile behind the logo, which on these black
 * pages flashes white and then shows a white card mid-screen.
 *
 * Those light pages do not load this file, so re-theming here reaches the
 * seven dark auth pages only and leaves management and /user untouched.
 * logo_small.png is a transparent RGBA PNG — the white came entirely from
 * the CSS fill, so dropping it is enough to put the mark on black.
 * ------------------------------------------------------------------ */

#loaderOpacityDiv {
  background: #000;
  opacity: 0.72;
}

#pelogo {
  background-color: #000;
  border-color: var(--sfl-blue);
}

/* The four bars that animate around the logo. */
.loader {
  background-color: var(--sfl-blue);
}
