/* ==========================================================================
   Farmhouse A-Z: sign-in pages (light theme, no motion)
   One 1440x810 frame that covers the viewport. Everything is sized in frame units (--u).
   ========================================================================== */

:root {
  --u: max(calc(100vw / 1440), calc(100vh / 810));
  --page: #ffffff;
  --ink: #14172b;
  --muted: #5b6178;
  --line: #e7e2d8;
  --gold: #ffb347;
  --ember: #f28a2e;
  --sans: 'Urbanist', 'Segoe UI', system-ui, sans-serif;
  --display: 'Archivo', 'Arial Black', Impact, sans-serif;
}

html, body.hero-body { height: 100%; }

body.hero-body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Stage + frame (visual backdrop only) ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; background: var(--page); }

.frame {
  position: absolute;
  width: calc(1440 * var(--u));
  height: calc(810 * var(--u));
  left: calc(50% - 720 * var(--u));
  top: calc(50% - 405 * var(--u));
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 40%, #fff8ee 70%, #ffefd6 100%);
}

/* Soft golden horizon over the fields */
.horizon {
  position: absolute;
  width: calc(2600 * var(--u));
  height: calc(1300 * var(--u));
  left: calc(720 * var(--u) - 1300 * var(--u));
  top: calc(600 * var(--u));
  border-radius: 50%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #f7e6c4 0%, #f3dcaf 55%, #efd29c 61%, transparent 61.5%);
  box-shadow:
    0 calc(-2 * var(--u)) calc(10 * var(--u)) rgba(255, 190, 100, .55),
    0 calc(-20 * var(--u)) calc(90 * var(--u)) rgba(255, 179, 71, .30);
}
.horizon::after {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  border-top: calc(2 * var(--u)) solid rgba(242, 138, 46, .55);
  background: repeating-linear-gradient(100deg, rgba(210, 150, 60, .10) 0 calc(6 * var(--u)), transparent calc(6 * var(--u)) calc(18 * var(--u)));
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 62%);
}

/* Optional photo: drop your own image at wwwroot/media/hero.jpg (1920x1080). */
.plate { position: absolute; inset: 0; background: url('/media/hero.jpg') center / cover no-repeat; }

/* Static warm sun glow on the horizon */
.sun {
  position: absolute;
  width: calc(520 * var(--u));
  height: calc(520 * var(--u));
  left: calc(460 * var(--u));
  top: calc(325 * var(--u));
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 140, .75) 0%, rgba(255, 190, 100, .35) 18%, rgba(255, 179, 71, .10) 40%, transparent 65%);
  pointer-events: none;
}

/* ---------- Header + captions (pinned to the screen) ---------- */
.hero-logo {
  position: fixed; z-index: 5;
  /* Centred at the top of the page, above the baker and the sign-in card */
  left: 50%; transform: translateX(-50%); top: calc(40 * var(--u));
  white-space: nowrap;
  display: flex; align-items: center; gap: calc(12 * var(--u));
  color: var(--ink); text-decoration: none;
  font: 600 calc(29.5 * var(--u)) / 1 var(--sans);
  letter-spacing: -.01em;
}
.logo-disc {
  /* Farmhouse Bakery logo (wwwroot/media/logo.png) */
  width: calc(58 * var(--u)); height: calc(55 * var(--u));
  background: url("/media/logo.png") center / contain no-repeat;
  flex: none;
}

.hero-menu {
  position: fixed; z-index: 6;
  right: calc(57 * var(--u)); top: calc(55 * var(--u));
  width: calc(25 * var(--u)); height: calc(25 * var(--u));
  display: flex; flex-direction: column; justify-content: center; gap: calc(5 * var(--u));
  background: none; border: 0; padding: 0; color: var(--ink);
}
.hero-menu span { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 2px; }
.hero-menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(calc(5 * var(--u) + 2px)) rotate(45deg); }
.hero-menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hero-menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(calc(-5 * var(--u) - 2px)) rotate(-45deg); }

.menu-panel {
  position: fixed; z-index: 5;
  right: calc(45 * var(--u)); top: calc(96 * var(--u));
  min-width: 220px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(20, 23, 43, .12);
  display: none;
}
.menu-panel.open { display: block; }
.menu-panel a {
  display: block; padding: 10px 14px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px;
}
.menu-panel a:hover, .menu-panel a:focus-visible { background: #fff4e3; }

.caption {
  position: fixed; z-index: 4; bottom: calc(53 * var(--u));
  font: 700 calc(12.2 * var(--u)) / 1 var(--sans);
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.caption.left { left: calc(55 * var(--u)); }
.caption.right { right: calc(55 * var(--u)); }

/* ---------- Baker + card ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 3;
  overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* leave room on the left for the baker */
  padding: calc(110 * var(--u)) 16px calc(100 * var(--u)) calc(16px + 380 * var(--u));
}

/* The baker stands on the horizon, bottom-left of the card */
.baker {
  position: fixed; z-index: 2;
  bottom: 0;
  left: calc(50% - 560 * var(--u));
  height: min(calc(720 * var(--u)), 90vh);
  aspect-ratio: 544 / 974;
  pointer-events: none;
}
.baker svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 10px 24px rgba(120, 70, 20, .18)); }

.card-glass {
  position: relative; z-index: 3;
  width: min(calc(440 * var(--u)), 100%);
  padding: calc(30 * var(--u)) calc(32 * var(--u));
  border-radius: calc(26 * var(--u));
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  box-shadow: 0 calc(24 * var(--u)) calc(60 * var(--u)) rgba(20, 23, 43, .10);
  backdrop-filter: blur(12px);
  font-size: calc(16 * var(--u));
}
.card-glass h2 { font: 700 calc(22 * var(--u)) / 1.2 var(--sans); margin: 0 0 calc(4 * var(--u)); color: var(--ink); }
.card-glass .lead-muted { color: var(--muted); font-size: calc(15 * var(--u)); margin: 0 0 calc(20 * var(--u)); }

.field { margin-bottom: calc(16 * var(--u)); }
.field label { display: block; font-weight: 600; font-size: calc(14 * var(--u)); color: var(--muted); margin-bottom: calc(6 * var(--u)); }
.field .input-wrap { position: relative; }
.field input {
  width: 100%;
  height: calc(50 * var(--u));
  padding: 0 calc(16 * var(--u));
  border-radius: calc(14 * var(--u));
  border: 1px solid #d9d4ca;
  background: #ffffff;
  color: var(--ink);
  font: 500 calc(16 * var(--u)) var(--sans);
  outline: none;
}
.field input::placeholder { color: #9aa0b4; }
.field input:focus { border-color: var(--ember); box-shadow: 0 0 0 calc(3 * var(--u)) rgba(255, 179, 71, .30); }
.field input[readonly] { color: var(--muted); background: #faf8f4; }
.field .text-danger, .val-summary { color: #c62828 !important; font-size: calc(13 * var(--u)); }
.val-summary ul { margin: 0 0 calc(12 * var(--u)); padding-left: 1.1em; }
.val-summary.validation-summary-valid { display: none; }

.toggle-pw {
  position: absolute; right: calc(8 * var(--u)); top: 50%; transform: translateY(-50%);
  height: calc(34 * var(--u)); padding: 0 calc(12 * var(--u));
  border-radius: 999px; border: 1px solid #d9d4ca;
  background: #ffffff; color: var(--muted);
  font: 700 calc(12 * var(--u)) var(--sans); letter-spacing: .08em; text-transform: uppercase;
}
.toggle-pw[aria-pressed="true"] { color: #1b0d02; background: var(--gold); border-color: var(--gold); }

/* Gold pill button */
.btn-glow {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  width: 100%;
  height: calc(54 * var(--u));
  margin-top: calc(6 * var(--u));
  border-radius: 999px;
  border: 1px solid #e07d22;
  background: linear-gradient(180deg, #ffc46b 0%, #ffa94a 55%, #f28a2e 100%);
  color: #1b0d02;
  font: 700 calc(16.5 * var(--u)) var(--sans); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 calc(8 * var(--u)) calc(20 * var(--u)) rgba(242, 138, 46, .28), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn-glow:hover { filter: brightness(1.04); color: #1b0d02; }
.btn-glow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-glow.ghost { background: #ffffff; color: var(--ink); border: 1px solid #d9d4ca; box-shadow: none; }
.btn-glow.ghost:hover { background: #fff4e3; }

.card-links { display: flex; justify-content: space-between; gap: 12px; margin-top: calc(16 * var(--u)); font-size: calc(14 * var(--u)); }
.card-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.card-links a:hover { color: var(--ink); }

.notice {
  border-radius: calc(14 * var(--u));
  padding: calc(12 * var(--u)) calc(14 * var(--u));
  margin-bottom: calc(16 * var(--u));
  font-size: calc(14.5 * var(--u));
  border: 1px solid;
}
.notice.ok { background: #e8f7ef; border-color: #a9dfc3; color: #145c38; }
.notice.err { background: #fdecec; border-color: #f2b8b8; color: #8e1c1c; }

/* Modal (forgot-password "contact admin") */
.hero-body .modal-content { border-radius: 22px; font-family: var(--sans); }

/* ---------- Phones (<= 820px) ---------- */
@media (max-width: 820px) {
  .hero-logo { top: 16px; font-size: 18px; gap: 8px; }
  .logo-disc { width: 44px; height: 42px; }
  .hero-menu { right: 18px; top: 20px; width: 24px; height: 24px; gap: 5px; }
  .hero-menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hero-menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .menu-panel { right: 12px; top: 60px; }
  .caption { bottom: 14px; font-size: 11px; }
  .caption.left { left: 18px; } .caption.right { right: 18px; }

  .overlay { padding: 64px 16px 48px; justify-content: flex-start; }
  /* Phones: baker becomes a head-and-shoulders portrait above the card */
  .baker {
    position: relative; left: auto; bottom: auto;
    height: 230px; width: 100%; aspect-ratio: auto;
    overflow: hidden; display: flex; justify-content: center;
    flex: none;
  }
  .baker svg { width: auto; height: 420px; }

  .card-glass { margin-top: 0; padding: 24px 20px; border-radius: 22px; font-size: 16px; width: min(440px, 100%); }
  .card-glass h2 { font-size: 20px; }
  .card-glass .lead-muted, .card-links, .notice, .field label { font-size: 14px; }
  .field input { height: 48px; border-radius: 12px; font-size: 16px; padding: 0 14px; }
  .field .text-danger, .val-summary { font-size: 13px; }
  .toggle-pw { height: 32px; font-size: 11px; padding: 0 10px; right: 8px; }
  .btn-glow { height: 52px; font-size: 15px; }
  .notice { border-radius: 12px; padding: 10px 12px; }
}
