:root {
  --font: system-ui, "Segoe UI", sans-serif;
  --ink: #16300a;
  --cream: #fffef5;
  --gold: #ffe082;
  --lime: #d8ff57;
  --sky: #5aa8c8;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body.farm-auth {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--cream);
  background-color: #79c7f2;
  background-image: url("/static/Sunny%20Countryside%20Farm%20Landscape.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.farm-ink {
  color: #fffef5;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95), 0 2px 3px rgba(0, 0, 0, 0.85);
}
.farm-gold {
  color: #ffe082;
  text-shadow: 0 1px 0 #fff3c4, 0 2px 0 #c98912, 0 3px 0 #9a6508, 0 4px 8px rgba(0, 0, 0, 0.75);
}
.farm-lime {
  color: #d8ff57;
  text-shadow: 0 1px 0 #f4ffc8, 0 2px 0 #6f9e14, 0 3px 0 #4e7410, 0 4px 8px rgba(0, 0, 0, 0.75);
}

.wrap {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding:
    calc(14px + var(--safe-top))
    16px
    calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand { text-align: center; padding-top: 6px; }

.logo {
  width: min(180px, 52vw);
  margin: 0 auto;
  background: transparent;
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
}
.logo img {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.brand h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.brand p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.steps {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.sheet { position: relative; z-index: 2; }

.steps li {
  flex: 1;
  text-align: center;
  padding: 7px 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #fff7e0;
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  touch-action: manipulation;
}
.steps li.is-on {
  color: #16300a;
  text-shadow: none;
  background: linear-gradient(180deg, #e4ff7a, #7fd22a);
  border-color: #255810;
}

.alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(90, 16, 16, 0.72);
  border: 1.5px solid rgba(255, 180, 180, 0.45);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 4px; }

.pane { display: none; }
.pane.is-on { display: block; animation: rise 0.32s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.pane h2 {
  margin: 4px 0 4px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}
.pane .sub {
  margin: 0 0 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.phone, .secret, .plain {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 254, 245, 0.94);
  border: 2px solid #255810;
  box-shadow: 0 4px 0 #1a420e;
}
.phone:focus-within, .secret:focus-within, .plain:focus {
  outline: 3px solid rgba(216, 255, 87, 0.55);
}

.dial {
  font-weight: 900;
  color: #245012;
  padding-right: 8px;
  border-right: 2px solid #c5e39a;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #16300a;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
}
.phone input,
.secret input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
input::placeholder { color: #8aa36a; font-weight: 800; }

.plain { letter-spacing: 0.16em; text-transform: uppercase; }
.plain::placeholder { letter-spacing: 0; text-transform: none; }

.eye {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: #16300a;
  background: #e4ff7a;
  cursor: pointer;
  touch-action: manipulation;
}
.eye svg { width: 20px; height: 20px; display: block; }
.eye .eye-off { display: none; }
.eye.is-open .eye-on { display: none; }
.eye.is-open .eye-off { display: block; }

.note {
  margin: 6px 2px 0;
  font-size: 12px;
  font-weight: 800;
}
.note.is-ok { color: #d8ff57; }
.note.is-bad { color: #ffd0d0; }

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 800;
}
.remember input { width: 18px; height: 18px; accent-color: #4ea816; }

.lock, .sum {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 12px;
}
.lock { display: flex; justify-content: space-between; align-items: center; }
.lock b { font-size: 20px; letter-spacing: 0.12em; }
.sum div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 800;
}

.nav { display: flex; gap: 8px; margin-top: 6px; }

.btn {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
}
.btn-back {
  flex: 0 0 96px;
  color: #d8ff57;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.btn-go {
  color: #16300a;
  border: 2px solid #1a420e;
  background: linear-gradient(180deg, #e4ff7a 0%, #b8ef3a 35%, #7fd22a 70%, #4ea816 100%);
  box-shadow: 0 4px 0 #255810, inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-go:active { transform: translateY(2px); box-shadow: 0 2px 0 #255810; }

.foot {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.foot a { color: #ffe082; font-weight: 900; text-decoration: none; }

@media (min-width: 900px) {
  .wrap {
    width: min(920px, calc(100% - 48px));
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 28px;
  }
  .brand { text-align: left; }
  .logo { margin-left: 0; width: 280px; }
  .brand h1 { font-size: 52px; }
  .sheet { max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  .pane.is-on { animation: none; }
}
