/* ============================================================
   BURBLE LOGIN — the sign-in pages
   ============================================================
   Landing page, login, 2FA, password reset and registration: every
   page that common/public_redesign/login_header.php wraps. Loaded there
   before burble-core.css (tokens, reset, .bc-* components). These pages
   load no burble-admin.css.

   Moved out of burble-admin.css, which keeps its own copies of the
   shared rules (html/body, .help-block, .alert). Only the danger alert
   is styled here: it is the only one a sign-in page shows
   (two_factor_qr.js).
   ============================================================ */

html,
body {
  height: 100%;
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* The page scrolls vertically and never horizontally. */
body.login-page {
  height: auto !important;
  min-height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: linear-gradient(
    135deg,
    #0d1b3e 0%,
    #133a6b 40%,
    #1e6db5 75%,
    #4fa3e0 100%
  );
}
html:has(body.login-page) {
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
}

body.login-page::before,
body.login-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
}
body.login-page::before {
  width: 520px;
  height: 520px;
  background: var(--blue-light);
  top: -120px;
  left: -120px;
}
body.login-page::after {
  width: 420px;
  height: 420px;
  background: var(--accent);
  bottom: -100px;
  right: -80px;
}

/* Cloud silhouettes drifting across the background (BBL-4422); created by
   the script in login_header.php. */
.particle {
  position: fixed;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 36' fill='white'><path d='M52 24c0-6-5-11-11-11-1 0-2 0-3 0-2-6-7-10-13-10-7 0-13 5-14 12-1 0-2 0-3 0-5 0-9 4-9 9s4 9 9 9h44c5 0 9-4 9-9 0-5-4-9-9-9z'/></svg>")
    no-repeat center / contain;
  opacity: 0;
  pointer-events: none;
  animation: drift linear infinite;
}
@keyframes drift {
  0% {
    transform: translateX(-15vw);
    opacity: 0;
  }
  10% {
    opacity: 0.08;
  }
  90% {
    opacity: 0.08;
  }
  100% {
    transform: translateX(115vw);
    opacity: 0;
  }
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  z-index: 1;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  animation: slideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-text h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--white);
  line-height: 1;
}
/* Trademark at cap height beside the wordmark, not on its baseline
   (BBL-4426): with line-height 1, vertical-align: top is the em box top. */
.logo-text h1 .logo-tm {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  vertical-align: top;
  line-height: 1;
  letter-spacing: normal;
  margin-left: 2px;
}
.logo-text > span {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
  display: block;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-card);
  padding: 44px 40px 36px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Widths for the cards that hold more than a sign-in form, and a centred one
   for the landing and status pages (confirm, success, not confirmed). */
.login-card--sm {
  max-width: 420px;
}
.login-card--md {
  max-width: 560px;
}
.login-card--lg {
  max-width: 680px;
}
.login-card--xl {
  max-width: 720px;
}
.login-card--center {
  text-align: center;
}
/* A page whose card is too tall to centre: it starts at the top instead. */
.page--top {
  justify-content: flex-start;
}
/* The logo over a tall card, with less room under it. */
.logo-area--compact {
  margin-bottom: 20px;
}

.login-card-header {
  margin-bottom: 30px;
}
.login-card-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--sl-900);
  margin-bottom: 4px;
}
.login-card-header p {
  font-size: 13.5px;
  color: var(--sl-500);
}

.input-wrap {
  position: relative;
}
.input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sl-500);
  pointer-events: none;
  transition: color 0.25s;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-input);
  font-size: 14.5px;
  color: var(--sl-900);
  background: var(--white);
  outline: none;
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    background 0.25s;
}
.input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(43, 125, 214, 0.12);
  background: var(--sl-50);
}
.input-wrap:focus-within .icon {
  color: var(--blue);
}
/* The label lights up with its field. login.js skips .bc-label and leaves
   this to CSS. */
.login-card .bc-form-group:focus-within > .bc-label {
  color: var(--blue);
}

/* jQuery Validate output from sign_up_validation.js: a .help-block message
   and .has-error on the .form-group. This shell loads no Bootstrap, which
   styles these on the legacy pages. */
.help-block {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--danger);
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error .iti input {
  border-color: var(--danger);
}
/* intl-tel-input's inline-block .iti would size to its content; full width
   matches the other fields. */
.input-wrap .iti {
  width: 100%;
}
.form-group.has-error input:focus,
.form-group.has-error select:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

/* Alert messages */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  border-left: 4px solid;
  position: relative;
}
.alert .close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.alert .close:hover {
  opacity: 1;
}

/* danger / error */
.alert-danger,
.alert-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-strong);
}
.alert-danger .close,
.alert-error .close {
  color: var(--danger-strong);
}

.eye-btn {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sl-500);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.eye-btn:hover {
  color: var(--blue);
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  margin-bottom: 24px;
}
.forgot-row a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-row a:hover {
  color: var(--teal-strong);
  text-decoration: underline;
}

.page .btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-input);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    filter 0.18s;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
}
.page .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 100%
  );
  pointer-events: none;
}
.page .btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  color: var(--white);
}
.page .btn-primary:active {
  transform: translateY(0);
}
/* The same button in the other two account colours (the landing page's
   Facility and Agent entries). */
.page .btn-primary--teal {
  background: linear-gradient(135deg, var(--teal), var(--teal-strong));
}
.page .btn-primary--slate {
  background: linear-gradient(135deg, var(--sl-500), var(--sl-700));
}

.page .btn-secondary {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  background: var(--sl-100);
  color: var(--sl-700);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-input);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s,
    color 0.18s,
    transform 0.18s;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
}
.page .btn-secondary:hover {
  background: var(--white);
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
  text-decoration: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sl-300);
}
.divider span {
  font-size: 12px;
  color: var(--sl-500);
  white-space: nowrap;
}

.signup-row {
  text-align: center;
  font-size: 13.5px;
  color: var(--sl-500);
  margin-top: 6px;
  line-height: 1.5;
}
.signup-row a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.signup-row a:hover {
  color: var(--teal-strong);
  text-decoration: underline;
}

.trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
.trust-badge svg {
  width: 14px;
  height: 14px;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 16px;
  margin-top: auto;
}
footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 10px;
}
footer a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}
footer a:hover {
  color: rgba(255, 255, 255, 0.9);
}
footer .copy {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.35);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.3);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 20px 14px;
  }
  .logo-area {
    margin-bottom: 20px;
  }
  .login-card {
    padding: 28px 22px 24px;
  }
  .login-card-header {
    margin-bottom: 20px;
  }
}
@media (max-width: 480px) {
  .page {
    padding: 12px 10px;
  }
  .logo-area {
    margin-bottom: 14px;
    gap: 10px;
  }
  .login-card {
    padding: 22px 18px 18px;
  }
  .login-card-header {
    margin-bottom: 16px;
  }
  .logo-text h1 {
    font-size: 24px;
  }
  .logo-text > span {
    font-size: 11px;
  }
}
