:root {
  --bbf-bg: #f7f8fb;
  --bbf-surface: #ffffff;
  --bbf-text: #0f172a;
  --bbf-muted: #64748b;
  --bbf-line: #dce3ee;
  --bbf-primary: rgb(15, 39, 86);
  --bbf-accent: #08aeb5;
  --bbf-danger: #b42318;
  --bbf-success: #067647;
  --bbf-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bbf-bg);
  color: var(--bbf-text);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--bbf-primary);
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  color: #0b3a78;
}

.bbf-login-shell {
  width: min(1160px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 430px;
  align-items: center;
  gap: 24px;
  padding: 56px 0;
}

.bbf-login-shell--compact {
  width: min(480px, calc(100% - 32px));
  grid-template-columns: 1fr;
  justify-items: center;
}

.bbf-login-shell--compact .bbf-auth-card {
  min-height: 0;
}

.bbf-login-hero {
  position: relative;
  min-height: 586px;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 30px;
  padding: 36px;
  border: 1px solid var(--bbf-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
  isolation: isolate;
}

.bbf-login-hero::after {
  display: none;
}

.bbf-login-copy {
  max-width: 660px;
}

.bbf-login-copy p {
  margin: 0 0 16px;
  color: #4f46e5;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.bbf-login-copy h1 {
  margin: 0;
  color: var(--bbf-text);
  font-size: 42px;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.bbf-login-copy span {
  display: block;
  max-width: 540px;
  margin-top: 20px;
  color: var(--bbf-muted);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.45;
}

.bbf-login-image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  height: 270px;
  min-height: 0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.bbf-login-image img {
  display: block;
  width: min(92%, 560px);
  height: auto;
  max-height: 82%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  transform: none;
}

.bbf-auth-card {
  width: 100%;
  min-height: 586px;
  padding: 36px;
  border: 1px solid var(--bbf-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(18px);
}

.bbf-auth-card__head {
  margin-bottom: 24px;
}

.bbf-auth-card__brand {
  display: none;
}

.bbf-login-shell--compact .bbf-auth-card__brand {
  display: block;
  width: 168px;
  height: auto;
  margin: 0 0 20px;
}

.bbf-auth-card__head > span {
  color: #4f46e5;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.bbf-auth-card h1,
.bbf-auth-card h2 {
  margin: 8px 0 10px;
  color: var(--bbf-text);
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.bbf-auth-card p {
  margin: 0;
  color: var(--bbf-muted);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.45;
}

.bbf-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  color: var(--bbf-primary);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.bbf-alert--error {
  background: #fff4f2;
  color: var(--bbf-danger);
}

.bbf-alert--success {
  background: #ecfdf3;
  color: var(--bbf-success);
}

.bbf-alert--warning {
  background: #fffaeb;
  color: #93370d;
}

.bbf-form {
  display: grid;
  gap: 16px;
}

.bbf-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bbf-selected-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--bbf-line);
  border-radius: 18px;
  background: #f8fafc;
}

.bbf-selected-account span {
  grid-column: 1 / -1;
  color: #53637a;
  font-size: 13px;
  font-weight: 900;
}

.bbf-selected-account strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--bbf-text);
  font-size: 16px;
  font-weight: 900;
}

.bbf-selected-account a {
  font-size: 13px;
  white-space: nowrap;
}

.bbf-field {
  display: grid;
  gap: 8px;
  color: #53637a;
  font-size: 13px;
  font-weight: 900;
}

.bbf-field input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--bbf-line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--bbf-text);
  padding: 0 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.bbf-field input:focus {
  border-color: #0b7cff;
  box-shadow: 0 0 0 4px rgba(11, 124, 255, 0.12);
}

.bbf-field input[aria-invalid="true"] {
  border-color: #f04438;
}

.bbf-avatar-field {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--bbf-line);
  border-radius: 20px;
  background: #f8fafc;
}

.bbf-avatar-field__head {
  display: grid;
  gap: 4px;
}

.bbf-avatar-field__head span {
  color: #53637a;
  font-size: 13px;
  font-weight: 900;
}

.bbf-avatar-field__head strong {
  color: var(--bbf-text);
  font-size: 15px;
  font-weight: 900;
}

.bbf-avatar-field__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-items: center;
}

.bbf-avatar-preview {
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 2px solid var(--bbf-primary);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 39, 86, 0.16);
}

.bbf-avatar-preview img,
.bbf-avatar-preset img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bbf-avatar-actions {
  width: 100%;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bbf-avatar-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 2px;
}

.bbf-avatar-preset {
  display: grid;
  gap: 6px;
  justify-items: center;
  align-items: center;
  min-width: 0;
  min-height: 74px;
  padding: 4px;
  border: 1px solid var(--bbf-line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--bbf-text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.bbf-avatar-preset[aria-pressed="true"] {
  border-color: #0b7cff;
  box-shadow: 0 0 0 3px rgba(11, 124, 255, 0.13);
}

.bbf-avatar-preset img {
  max-width: 100%;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #eef6ff;
}

.bbf-avatar-preset span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bbf-avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--bbf-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--bbf-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}

.bbf-avatar-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bbf-field-error {
  color: var(--bbf-danger) !important;
  font-size: 14px !important;
}

.bbf-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
}

.bbf-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--bbf-text);
  font-size: 14px;
  font-weight: 800;
}

.bbf-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--bbf-primary);
}

.bbf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--bbf-primary);
  color: #ffffff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 16px 36px rgba(15, 39, 86, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.bbf-submit:hover {
  background: #0b3472;
  box-shadow: 0 18px 40px rgba(15, 39, 86, 0.28);
  transform: translateY(-1px);
}

.bbf-submit--link {
  text-decoration: none;
}

.bbf-back-link {
  justify-self: center;
  margin-top: 6px;
}

.bbf-auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--bbf-line);
  color: var(--bbf-muted);
  font-size: 15px;
  font-weight: 750;
}

.bbf-auth-switch a {
  color: var(--bbf-primary);
  font-weight: 900;
}

@media (max-width: 860px) {
  body {
    background:
      radial-gradient(circle at 50% -10%, rgba(8, 174, 181, 0.12), transparent 34%),
      var(--bbf-bg);
  }

  .bbf-login-shell {
    width: min(480px, calc(100% - 28px));
    min-height: auto;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
    padding: 22px 0 34px;
  }

  .bbf-login-hero {
    display: none;
  }

  .bbf-auth-card {
    min-height: 0;
    padding: 28px;
  }

  .bbf-auth-card__head {
    margin-bottom: 22px;
  }

  .bbf-auth-card__brand {
    display: block;
    width: 142px;
    height: auto;
    margin: 0 0 18px;
  }
}

@media (max-width: 560px) {
  .bbf-login-shell {
    width: min(100% - 24px, 460px);
    align-items: start;
    padding: 14px 0 24px;
  }

  .bbf-login-copy h1 {
    font-size: 30px;
    line-height: 1;
  }

  .bbf-login-copy span {
    margin-top: 14px;
    font-size: 16px;
  }

  .bbf-login-image {
    height: 210px;
    border-radius: 24px;
  }

  .bbf-login-image img {
    width: min(92%, 360px);
    height: auto;
  }

  .bbf-auth-card {
    min-height: 0;
    padding: 24px;
    border-radius: 24px;
  }

  .bbf-auth-card__brand {
    width: 128px;
    margin-bottom: 16px;
  }

  .bbf-auth-card h1,
  .bbf-auth-card h2 {
    font-size: 34px;
  }

  .bbf-form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .bbf-form-grid {
    grid-template-columns: 1fr;
  }

  .bbf-avatar-field__body {
    grid-template-columns: 1fr;
  }

  .bbf-avatar-preview {
    justify-self: center;
  }

  .bbf-avatar-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bbf-auth-switch {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
