/* Bienfo B2B admin: login / sign up
   Layout: 4/12 brand panel + 8/12 form panel. Stacks at 1024px. */

:root {
  --bfl-green: #6a9c3d;
  --bfl-green-dark: #557d2f;
  --bfl-forest: #23361a;
  --bfl-forest-deep: #16230f;
  --bfl-ink: #2b2320;
  --bfl-muted: #948c80;
  --bfl-line: #e2ddd1;
  --bfl-cream: #f7f5ef;
  --bfl-danger: #c8442f;
  --bfl-ease: cubic-bezier(.22, .8, .24, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

.bfl-body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--bfl-ink);
  background: var(--bfl-cream);
  -webkit-font-smoothing: antialiased;
}

:where(.bfl) :where(button, input, textarea) { font: inherit; color: inherit; }

.bfl-nowrap { white-space: nowrap; }

.bfl {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ------------------------------------------------------------------ */
/* Brand panel (left, 4 columns)                                       */
/* ------------------------------------------------------------------ */

.bfl-brand {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  color: #fff;
  background: var(--bfl-forest-deep);
  isolation: isolate;
}

.bfl-brand-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(22, 35, 15, .55) 0%, rgba(22, 35, 15, .78) 48%, rgba(15, 25, 10, .96) 100%),
    linear-gradient(135deg, rgba(106, 156, 61, .38), rgba(35, 54, 26, .2)),
    var(--bfl-photo) center / cover no-repeat;
  transform: scale(1.04);
  animation: bflZoom 18s ease-out both;
}

/* soft light + fine dot texture */
.bfl-brand-bg::before,
.bfl-brand-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.bfl-brand-bg::before {
  width: 520px;
  height: 520px;
  right: -220px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 197, 80, .38), rgba(140, 197, 80, 0) 68%);
}

.bfl-brand-bg::after {
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent 60%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent 60%);
}

.bfl-brand-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  height: 100%;
  padding: clamp(28px, 4vw, 56px);
}

.bfl-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.bfl-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ad25a;
  box-shadow: 0 0 0 4px rgba(154, 210, 90, .25);
}

.bfl-headline {
  margin: 0;
  font-family: "Fredoka", "Manrope", sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 2.5vw + 8px, 46px);
  line-height: 1.14;
  letter-spacing: -.01em;
  color: #fff;
}

.bfl-hl { color: #a9d874; }

.bfl-lead {
  margin: 20px 0 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .8);
}

.bfl-stats {
  display: flex;
  gap: 0;
  margin: 34px 0 0;
  padding: 22px 0 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.bfl-stats li {
  flex: 1 1 0;
  min-width: 0;
  padding-right: 14px;
}

.bfl-stats li + li {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, .14);
}

.bfl-stats strong {
  display: block;
  font-family: "Fredoka", "Manrope", sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
}

.bfl-stats span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, .62);
}

.bfl-certs-label {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.bfl-certs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.bfl-certs-row img {
  display: block;
  width: auto;
  height: 28px;
  border-radius: 6px;
  filter: brightness(0) invert(1);
  opacity: .5;
}

/* ------------------------------------------------------------------ */
/* Form panel (right, 8 columns)                                       */
/* ------------------------------------------------------------------ */

.bfl-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  background:
    radial-gradient(700px 420px at 100% 0%, rgba(106, 156, 61, .12), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, rgba(106, 156, 61, .08), transparent 70%),
    var(--bfl-cream);
}

.bfl-card {
  width: 100%;
  max-width: 540px;
  padding: 40px 44px 36px;
  border-radius: 24px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(35, 54, 26, .05),
    0 2px 6px rgba(35, 54, 26, .04),
    0 34px 60px -28px rgba(35, 54, 26, .28);
  animation: bflRise .7s var(--bfl-ease) both;
}

.bfl-logo {
  display: block;
  width: fit-content;
  margin: 0 auto 28px;
  line-height: 0;
}

.bfl-logo img {
  display: block;
  width: auto;
  height: 52px;
  max-width: 100%;
}

/* tabs */
.bfl-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-radius: 14px;
  background: #f1eee6;
}

.bfl-tab-pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(35, 54, 26, .1), 0 4px 12px -4px rgba(35, 54, 26, .18);
  transition: transform .38s var(--bfl-ease);
}

.bfl-tabs[data-active="signup"] .bfl-tab-pill { transform: translateX(100%); }

.bfl-tab {
  position: relative;
  z-index: 1;
  padding: 12px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--bfl-muted);
  cursor: pointer;
  transition: color .25s ease;
}

.bfl-tab[aria-selected="true"] { color: var(--bfl-forest); }

.bfl-tab:focus-visible {
  outline: 3px solid rgba(106, 156, 61, .45);
  outline-offset: 1px;
}

@media (hover: hover) {
  .bfl-tab[aria-selected="false"]:hover { color: var(--bfl-ink); }
}

/* panel heading */
.bfl-tabpanel { padding-top: 28px; }
.bfl-tabpanel:not([hidden]) { animation: bflFade .45s var(--bfl-ease) both; }

.bfl-title {
  margin: 0;
  font-family: "Fredoka", "Manrope", sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--bfl-forest);
}

.bfl-sub {
  margin: 6px 0 24px;
  font-size: 14px;
  color: var(--bfl-muted);
}

/* fields */
.bfl-field { margin-bottom: 16px; }

.bfl-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bfl-ink);
}

.bfl-opt {
  font-weight: 500;
  color: var(--bfl-muted);
}

.bfl-input { position: relative; }

.bfl-input > svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: #a79f92;
  pointer-events: none;
  transition: color .2s ease;
}

.bfl-input input,
.bfl-input textarea {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  border: 1.5px solid var(--bfl-line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: var(--bfl-ink);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.bfl-input input[type="password"],
.bfl-input input.bfl-has-eye { padding-right: 48px; }

.bfl-input textarea {
  height: auto;
  min-height: 92px;
  padding: 14px 16px 14px 44px;
  resize: vertical;
  line-height: 1.5;
}

.bfl-input-area > svg { top: 17px; margin-top: 0; }

.bfl-input input::placeholder,
.bfl-input textarea::placeholder { color: #b8b1a5; font-weight: 500; }

.bfl-input input:focus,
.bfl-input textarea:focus {
  border-color: var(--bfl-green);
  box-shadow: 0 0 0 4px rgba(106, 156, 61, .16);
}

.bfl-input:focus-within > svg { color: var(--bfl-green); }

@media (hover: hover) {
  .bfl-input input:not(:focus):hover,
  .bfl-input textarea:not(:focus):hover { border-color: #cfc8b8; }
}

.bfl-field.is-error .bfl-input input,
.bfl-field.is-error .bfl-input textarea {
  border-color: var(--bfl-danger);
  background: #fffafa;
}

.bfl-field.is-error .bfl-input input:focus,
.bfl-field.is-error .bfl-input textarea:focus { box-shadow: 0 0 0 4px rgba(200, 68, 47, .14); }

.bfl-field.is-error .bfl-input > svg { color: var(--bfl-danger); }

.bfl-error {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bfl-danger);
}

.bfl-field.is-error .bfl-error { display: block; }

.bfl-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.bfl-pair > .bfl-field { min-width: 0; }

/* password toggle */
.bfl-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a79f92;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}

.bfl-eye svg { position: static; width: 18px; height: 18px; margin: 0; }
.bfl-eye .bfl-eye-off { display: none; }
.bfl-eye[aria-pressed="true"] .bfl-eye-on { display: none; }
.bfl-eye[aria-pressed="true"] .bfl-eye-off { display: block; }
.bfl-eye:focus-visible { outline: 3px solid rgba(106, 156, 61, .45); }

@media (hover: hover) {
  .bfl-eye:hover { color: var(--bfl-green); background: rgba(106, 156, 61, .1); }
}

/* remember + forgot */
.bfl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 22px;
}

.bfl-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: #5f574c;
  cursor: pointer;
  user-select: none;
}

.bfl-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.bfl-check-box {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1.5px solid #cfc8b8;
  border-radius: 6px;
  background: #fff;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.bfl-check-box svg {
  width: 12px;
  height: 12px;
  color: #fff;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .2s var(--bfl-ease);
}

.bfl-check input:checked + .bfl-check-box { background: var(--bfl-green); border-color: var(--bfl-green); }
.bfl-check input:checked + .bfl-check-box svg { opacity: 1; transform: scale(1); }
.bfl-check input:focus-visible + .bfl-check-box { box-shadow: 0 0 0 4px rgba(106, 156, 61, .25); }

/* links */
.bfl-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bfl-green-dark);
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease;
}

.bfl-link:focus-visible {
  outline: 3px solid rgba(106, 156, 61, .4);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (hover: hover) {
  .bfl-link:hover { color: var(--bfl-forest); text-decoration: underline; text-underline-offset: 3px; }
}

/* submit */
.bfl-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #7bb04a, #5d8c33);
  box-shadow: 0 10px 22px -10px rgba(85, 125, 47, .7), inset 0 1px 0 rgba(255, 255, 255, .22);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  color: #fff;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.bfl-submit svg {
  width: 18px;
  height: 18px;
  transition: transform .25s var(--bfl-ease);
}

@media (hover: hover) {
  .bfl-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px -12px rgba(85, 125, 47, .75), inset 0 1px 0 rgba(255, 255, 255, .22);
    filter: brightness(1.04);
  }
  .bfl-submit:hover svg { transform: translateX(4px); }
}

.bfl-submit:active { transform: translateY(0); filter: brightness(.97); }
.bfl-submit:focus-visible { outline: 3px solid rgba(106, 156, 61, .45); outline-offset: 3px; }

.bfl-switch {
  margin: 22px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  color: var(--bfl-muted);
}

/* flash message (backend hook) */
.bfl-flash {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.bfl-flash-error { color: #9a2f1d; background: #fdf0ed; border: 1px solid #f3cfc7; }
.bfl-flash-success { color: #3f6a1f; background: #eef6e6; border: 1px solid #cfe4bb; }

/* ------------------------------------------------------------------ */
/* Animations                                                          */
/* ------------------------------------------------------------------ */

@keyframes bflZoom { from { transform: scale(1.12); } to { transform: scale(1.04); } }
@keyframes bflRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bflFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .bfl-brand-bg,
  .bfl-card,
  .bfl-tabpanel:not([hidden]) { animation: none; }
  .bfl-tab-pill,
  .bfl-submit,
  .bfl-submit svg { transition: none; }
}

/* ------------------------------------------------------------------ */
/* Tablet and mobile: stack, brand panel becomes a slim banner         */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .bfl { grid-template-columns: minmax(0, 1fr); }

  .bfl-brand {
    position: relative;
    height: auto;
    min-height: 0;
  }

  .bfl-brand-inner {
    gap: 22px;
    height: auto;
    padding: 36px 32px 84px;
  }

  .bfl-headline { font-size: clamp(26px, 4.4vw, 36px); }
  .bfl-lead { max-width: 52ch; margin-top: 14px; }
  .bfl-stats { display: none; }
  .bfl-certs { display: none; }

  .bfl-panel {
    position: relative;
    z-index: 1;
    align-items: flex-start;
    margin-top: -56px;
    padding: 0 20px 40px;
    background: transparent;
  }

  .bfl-card { padding: 34px 32px 30px; }
}

@media (max-width: 560px) {
  .bfl-brand-inner { padding: 26px 20px 76px; gap: 16px; }
  .bfl-headline { font-size: 25px; }
  .bfl-lead { font-size: 14px; }

  .bfl-panel { margin-top: -50px; padding: 0 14px 28px; }
  .bfl-card { padding: 28px 20px 24px; border-radius: 20px; }
  .bfl-logo { margin-bottom: 22px; }
  .bfl-logo img { height: 46px; }
  .bfl-title { font-size: 23px; }
  .bfl-pair { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .bfl-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
