/* BitAgrix sign-in / create-account pages (/login, /register).
   Split-screen on desktop; a compact farm header over a full-width card on tablet;
   a clean light screen on phones.

   Farm photo: drop a file named farm-hero.jpg into assets/images/auth/ and it is layered over the
   built-in illustrated scene automatically (see --bx-hero below) — no markup or CSS change needed. */

:root {
  --bx-green: #2e7d32;
  --bx-green-dark: #1f6428;
  --bx-green-deep: #0a3d2a;
  --bx-green-deeper: #06281c;
  --bx-ink: #0f2d46;
  --bx-muted: #5b7083;
  --bx-line: #dce5e0;
  --bx-field: #f6f9f7;
  --bx-danger: #c62828;
  --bx-hero: url("/assets/images/auth/farm-hero.jpg"), url("/assets/images/auth/farm-hero.svg");
}

.bx-auth, .bx-auth * { box-sizing: border-box; }
html:has(.bx-auth), body.bx-body { margin: 0; min-height: 100%; background: var(--bx-green-deeper); }

.bx-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 55fr 45fr;
  font-family: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--bx-ink);
  position: relative;
  overflow: hidden;
  background: var(--bx-green-deeper);
}

/* ------------------------------------------------------------- brand */
.bx-logo { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--bx-ink); }
.bx-logo img { width: 58px; height: 58px; display: block; flex-shrink: 0; }
.bx-wordmark { font-size: 2.55rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; color: var(--bx-ink); display: inline-flex; align-items: baseline; }
.bx-wordmark .bx-agrix { color: var(--bx-green); }
.bx-wordmark .bx-i { position: relative; display: inline-block; }
.bx-wordmark .bx-i::after { content: ""; position: absolute; width: .3em; height: .2em; top: -.12em; left: .06em; background: var(--bx-green); border-radius: 0 100% 0 100%; transform: rotate(-12deg); }
.bx-tagline { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .01em; color: var(--bx-ink); margin-top: .35rem; }
.bx-logo--card img { width: 46px; height: 46px; }
.bx-logo--card .bx-wordmark { font-size: 2.05rem; }

/* -------------------------------------------------------------- hero */
.bx-hero {
  position: relative;
  padding: clamp(1.75rem, 4vw, 4rem) calc(4.5rem + 1.5rem) clamp(1.75rem, 4vw, 4rem) clamp(1.75rem, 5.5vw, 5.75rem);
  background: linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,246,222,.12) 55%, rgba(10,61,42,.15) 100%), var(--bx-hero);
  background-size: cover;
  background-position: center bottom;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 1;
}
.bx-hero::before { /* readable text column: soft light wash on the left */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.38) 38%, rgba(255,255,255,0) 72%);
}
.bx-hero > * { position: relative; }
.bx-welcome { margin-top: clamp(2rem, 6vh, 4.5rem); }
.bx-welcome .bx-kicker { display: block; font-size: clamp(2.1rem, 3.5vw, 3.35rem); line-height: 1.08; font-weight: 300; color: #1e3b52; }
.bx-welcome h1 { margin: 0; font-size: clamp(2.2rem, 3.8vw, 3.6rem); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; color: #0c3a2a; }
.bx-welcome p { margin: 1.1rem 0 0; max-width: 29rem; font-size: 1.12rem; line-height: 1.55; color: #26465d; }

.bx-features { list-style: none; display: flex; flex-wrap: wrap; gap: 1.6rem clamp(1rem, 2.2vw, 2rem); margin: 2.1rem 0 0; padding: 0; }
.bx-features li { width: 5.7rem; text-align: center; font-size: .92rem; line-height: 1.25; font-weight: 600; color: #1e3b52; }
.bx-features .bx-fi { display: grid; place-items: center; width: 3.35rem; height: 3.35rem; margin: 0 auto .5rem; border-radius: 1rem; background: rgba(255,255,255,.82); color: var(--bx-green); font-size: 1.7rem; box-shadow: 0 6px 18px rgba(14, 70, 40, .12); }

.bx-ground { /* deep-green curve bottom-left with the sign-off */
  position: absolute; left: 0; bottom: 0; width: min(46%, 30rem); height: 30%; min-height: 12rem; z-index: 2;
  background: var(--bx-green-deep);
  border-top-right-radius: 100% 100%;
  display: flex; align-items: center; padding: 0 0 1.4rem clamp(1.75rem, 4.5vw, 4.4rem);
}
.bx-signoff { font-family: "Segoe Script", "Snell Roundhand", "Brush Script MT", "Apple Chancery", cursive; font-style: italic; font-size: clamp(1.15rem, 1.7vw, 1.6rem); line-height: 1.25; color: #fff; max-width: 11rem; }
.bx-signoff::after { content: ""; display: block; width: 8.5rem; height: 3px; margin-top: .7rem; border-radius: 3px; background: linear-gradient(90deg, #4fd36d, rgba(79,211,109,0)); transform: rotate(-4deg); }

/* ------------------------------------------------------- right panel */
.bx-side {
  position: relative; z-index: 3; margin-left: -4.5rem;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 6.2rem clamp(1.5rem, 3.4vw, 3.4rem) 3rem calc(4.5rem + clamp(1.5rem, 3.4vw, 3.4rem));
  background:
    radial-gradient(900px 560px at 85% 8%, rgba(55, 140, 80, .28), transparent 60%),
    radial-gradient(700px 600px at 10% 100%, rgba(18, 94, 58, .45), transparent 65%),
    linear-gradient(160deg, #0f5a3a 0%, var(--bx-green-deep) 55%, var(--bx-green-deeper) 100%);
  border-top-left-radius: 100% 24%;
  min-height: 100vh; min-height: 100dvh;
}
.bx-side::before, .bx-side::after { /* faint leaf shapes */
  content: ""; position: absolute; pointer-events: none; border-radius: 0 100% 0 100%; background: rgba(120, 200, 140, .07);
}
.bx-side::before { width: 24rem; height: 24rem; right: -6rem; bottom: -4rem; transform: rotate(18deg); }
.bx-side::after { width: 15rem; height: 15rem; left: 12%; top: 18%; transform: rotate(-24deg); background: rgba(120, 200, 140, .05); }
.bx-trust { position: absolute; top: 2.3rem; right: clamp(1.5rem, 3.4vw, 3.4rem); display: flex; align-items: center; gap: .7rem; color: #eaf6ee; font-size: .98rem; font-weight: 500; }
.bx-trust i { font-size: 1.55rem; line-height: 1; }
.bx-trust .bx-sep { opacity: .55; }

.bx-card {
  position: relative; z-index: 1; width: 100%; max-width: 36rem;
  background: #fff; border-radius: 1.45rem; padding: clamp(1.6rem, 2.7vw, 2.75rem);
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .12);
}
.bx-card .bx-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.bx-card h2 { margin: 0; font-size: 2rem; line-height: 1.15; font-weight: 800; color: var(--bx-ink); }
.bx-card .bx-sub { margin: .55rem 0 1.7rem; font-size: 1.12rem; color: var(--bx-muted); }

/* ------------------------------------------------------------ fields */
.bx-field { position: relative; margin-bottom: 1.05rem; }
.bx-field > i.bx-lead { position: absolute; left: 1.15rem; top: 0; height: 3.75rem; display: grid; place-items: center; font-size: 1.35rem; color: #5b6f7e; pointer-events: none; transition: color .15s; }
.bx-field input {
  width: 100%; height: 3.75rem; padding: 0 1.1rem 0 3.4rem; font: inherit; font-size: 1.08rem; color: var(--bx-ink);
  background: var(--bx-field); border: 1.5px solid var(--bx-line); border-radius: .95rem; outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.bx-field input::placeholder { color: #7a8d9a; opacity: 1; }
.bx-field input:hover { border-color: #c4d3cb; }
.bx-field input:focus { background: #fff; border-color: var(--bx-green); box-shadow: 0 0 0 4px rgba(46, 125, 50, .16); }
.bx-field:focus-within > i.bx-lead { color: var(--bx-green); }
.bx-field.has-toggle input { padding-right: 3.6rem; }
.bx-field.is-invalid input { border-color: var(--bx-danger); background: #fff8f8; }
.bx-field.is-invalid input:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .14); }
.bx-field-error { display: none; margin: .4rem .2rem 0; font-size: .88rem; font-weight: 600; color: var(--bx-danger); }
.bx-field.is-invalid .bx-field-error { display: flex; align-items: center; gap: .35rem; }
.bx-toggle {
  position: absolute; right: .5rem; top: .5rem; width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  border: 0; border-radius: .7rem; background: transparent; color: #5b6f7e; font-size: 1.4rem; cursor: pointer; transition: background-color .15s, color .15s;
}
.bx-toggle:hover { background: rgba(46, 125, 50, .08); color: var(--bx-green); }
.bx-toggle:focus-visible { outline: 3px solid rgba(46, 125, 50, .45); outline-offset: 1px; }
.bx-toggle i { transition: transform .15s; }
.bx-toggle[aria-pressed="true"] i { transform: scale(1.06); color: var(--bx-green); }

.bx-alert { display: none; align-items: flex-start; gap: .6rem; margin: 0 0 1.1rem; padding: .85rem 1rem; border-radius: .85rem; border: 1px solid #f1c0c0; background: #fdf0f0; color: #8e1c1c; font-size: .98rem; font-weight: 600; }
.bx-alert.d-none { display: none !important; }
.bx-alert:not(.d-none) { display: flex; }
.bx-alert i { font-size: 1.25rem; line-height: 1.2; }

.bx-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .35rem 0 1.4rem; font-size: .98rem; }
.bx-check { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; color: #34506a; user-select: none; }
.bx-check input { position: absolute; opacity: 0; width: 1.4rem; height: 1.4rem; margin: 0; cursor: pointer; }
.bx-check .bx-box { width: 1.4rem; height: 1.4rem; border-radius: .4rem; border: 1.5px solid #b6c5bd; background: #fff; display: grid; place-items: center; color: #fff; font-size: 1rem; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.bx-check .bx-box i { opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; }
.bx-check input:checked + .bx-box { background: var(--bx-green); border-color: var(--bx-green); }
.bx-check input:checked + .bx-box i { opacity: 1; transform: none; }
.bx-check input:focus-visible + .bx-box { box-shadow: 0 0 0 4px rgba(46, 125, 50, .28); }
.bx-link { color: var(--bx-green-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.bx-link:hover { color: #14501c; }
.bx-link:focus-visible { outline: 3px solid rgba(46, 125, 50, .45); outline-offset: 3px; border-radius: 4px; }

/* ----------------------------------------------------------- buttons */
.bx-btn {
  position: relative; width: 100%; height: 3.6rem; display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  border-radius: .95rem; border: 1.5px solid transparent; font: inherit; font-size: 1.12rem; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .15s, box-shadow .15s, transform .08s, border-color .15s, color .15s;
}
.bx-btn i { font-size: 1.35rem; line-height: 1; transition: transform .15s; }
.bx-btn-primary { background: linear-gradient(180deg, #34893a, var(--bx-green-dark)); color: #fff; box-shadow: 0 8px 18px -6px rgba(31, 100, 40, .6); }
.bx-btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #2f7f35, #195b22); box-shadow: 0 10px 22px -6px rgba(31, 100, 40, .7); color: #fff; }
.bx-btn-primary:hover:not(:disabled) i { transform: translateX(3px); }
.bx-btn-primary:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 4px 10px -4px rgba(31, 100, 40, .6); }
.bx-btn-outline { background: #fff; color: var(--bx-green-dark); border-color: var(--bx-green); }
.bx-btn-outline:hover { background: #f1f8f2; color: #14501c; }
.bx-btn-outline:active { transform: translateY(1px); }
.bx-btn:focus-visible { outline: 3px solid rgba(46, 125, 50, .5); outline-offset: 3px; }
.bx-btn:disabled { cursor: not-allowed; opacity: .7; box-shadow: none; }
.bx-btn .bx-spin { display: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: bx-spin .7s linear infinite; }
.bx-btn.is-loading .bx-spin { display: inline-block; }
.bx-btn.is-loading i, .bx-btn.is-loading .bx-btn-label-idle { display: none; }
.bx-btn .bx-btn-label-busy { display: none; }
.bx-btn.is-loading .bx-btn-label-busy { display: inline; }
@keyframes bx-spin { to { transform: rotate(360deg); } }

.bx-or { display: flex; align-items: center; gap: 1rem; margin: 1.35rem 0; color: #6b7f8d; font-size: .95rem; }
.bx-or::before, .bx-or::after { content: ""; flex: 1; height: 1px; background: var(--bx-line); }
.bx-foot { margin: 1.5rem 0 0; text-align: center; font-size: .98rem; color: #4a6276; }

/* The create-account card has five fields; tighten it so it still fits a 900px-high window. */
@media (min-width: 1024px) {
  .bx-card--compact { padding-top: 1.7rem; padding-bottom: 1.7rem; }
  .bx-card--compact .bx-logo { margin-bottom: .9rem; }
  .bx-card--compact .bx-sub { margin: .4rem 0 1.1rem; }
  .bx-card--compact .bx-field { margin-bottom: .7rem; }
  .bx-card--compact .bx-field input, .bx-card--compact .bx-field > i.bx-lead { height: 3.3rem; }
  .bx-card--compact .bx-toggle { top: .275rem; }
  .bx-card--compact .bx-btn { height: 3.3rem; }
  .bx-card--compact .bx-or { margin: .95rem 0; } .bx-card--compact .bx-foot { margin-top: .95rem; }
  .bx-side:has(.bx-card--compact) { padding-top: 5rem; padding-bottom: 1.5rem; }
}

/* ---------------------------------------------------------- tablet */
@media (max-width: 1199.98px) {
  .bx-features li { width: 4.9rem; font-size: .84rem; }
  .bx-features .bx-fi { width: 3rem; height: 3rem; font-size: 1.5rem; }
  .bx-wordmark { font-size: 2.1rem; } .bx-logo img { width: 48px; height: 48px; }
  .bx-welcome p { font-size: 1rem; }
}
@media (max-width: 1023.98px) {
  .bx-auth { grid-template-columns: 1fr; }
  .bx-hero { min-height: 0; padding: 1.5rem 1.75rem 6.5rem; }
  .bx-hero::before { background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.1)); }
  .bx-features, .bx-ground, .bx-welcome p { display: none; }
  .bx-welcome { margin-top: 1.5rem; }
  .bx-welcome .bx-kicker { font-size: 1.6rem; } .bx-welcome h1 { font-size: 2.1rem; }
  .bx-side { margin: -4.8rem 0 0; border-radius: 0; padding: 0 1.75rem 3rem; min-height: 0; background: transparent; }
  html:has(.bx-auth), body.bx-body, .bx-auth { background: linear-gradient(180deg, #f1f7f2 0%, #e4f0e7 100%); }
  .bx-side::before, .bx-side::after { display: none; }
  .bx-trust { position: static; order: 2; margin: 1.4rem 0 0; color: #16543a; }
  .bx-card { max-width: 34rem; }
}

/* ------------------------------------------------------------ phone */
@media (max-width: 575.98px) {
  .bx-auth { background: linear-gradient(180deg, #e6f3ea 0%, #f4faf5 38%, #eaf4ec 100%); }
  .bx-hero { padding: 1.4rem 1.25rem 0; background: none; text-align: center; }
  .bx-hero::before { display: none; }
  .bx-hero .bx-logo { justify-content: center; }
  .bx-welcome { display: none; }
  .bx-side { margin: 0; padding: 0 1rem 2rem; }
  .bx-trust { display: none; }
  .bx-card { margin-top: 1.25rem; max-width: none; padding: 1.5rem 1.25rem 1.6rem; border-radius: 1.25rem; box-shadow: 0 18px 40px -20px rgba(10, 61, 42, .35), 0 1px 3px rgba(0, 0, 0, .08); }
  .bx-card > .bx-logo { display: none; }
  .bx-card h2 { font-size: 1.75rem; } .bx-card .bx-sub { font-size: 1.02rem; margin-bottom: 1.35rem; }
  .bx-field input, .bx-field > i.bx-lead { height: 3.6rem; } .bx-toggle { top: .425rem; }
  .bx-field input { font-size: 1rem; }
  .bx-row { font-size: .92rem; }
  .bx-wordmark { font-size: 2.2rem; }
  .bx-auth::after { /* a strip of the farm scene at the foot of the page */
    content: ""; display: block; height: 7.5rem; background: var(--bx-hero); background-size: cover; background-position: 30% bottom; opacity: .9;
    mask-image: linear-gradient(180deg, transparent, #000 70%); -webkit-mask-image: linear-gradient(180deg, transparent, #000 70%);
  }
}
@media (max-width: 359.98px) { .bx-row { flex-direction: column; align-items: flex-start; gap: .8rem; } }

/* short desktop windows: keep the card in view */
@media (min-width: 1024px) and (max-height: 760px) {
  .bx-side { padding-top: 5.2rem; padding-bottom: 1.5rem; }
  .bx-card { padding: 1.5rem 2rem; } .bx-card .bx-logo { margin-bottom: .9rem; } .bx-card .bx-sub { margin-bottom: 1.1rem; }
  .bx-field input, .bx-field > i.bx-lead { height: 3.3rem; } .bx-toggle { top: .275rem; }
  .bx-btn { height: 3.3rem; } .bx-or { margin: .9rem 0; } .bx-foot { margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bx-auth *, .bx-auth *::before, .bx-auth *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* Success variant of the auth alert (forgot / reset / verify pages). */
.bx-alert.bx-alert--ok { border-color: #b9e0c0; background: #eef8f0; color: #1f6b2c; }
.bx-state-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 2rem; background: #eef8f0; color: #2e7d32; }
.bx-state-icon.is-pending { background: #fff6e0; color: #9a6b00; }
.bx-center { text-align: center; }
