:root {
  --wood-dark: #5a3a1b;
  --wood-mid: #7a4f27;
  --wood-light: #9c6b38;
  --cream: #fff8ec;
  --green-1: #2ec27e;
  --green-2: #1fa968;
  --amber-1: #ffb224;
  --amber-2: #f08c00;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  color: #fff;
  background: url('background-siruli.webp') center / cover no-repeat fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,34,18,.6), rgba(5,24,13,.72));
  z-index: 0;
}

/* ===================== LOGIN CARD ===================== */
.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: cardIn .7s cubic-bezier(.17,.67,.3,1.25) both;
}

/* brand on top */
.login-brand {
  text-align: center;
  margin-bottom: 18px;
  animation: fadeUp .7s ease .1s both;
}
.login-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.5));
  animation: popIn .8s cubic-bezier(.17,.67,.3,1.4) both;
}
.login-brand h1 {
  font-family: 'Baloo 2', cursive;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 6px;
  color: #fff;
  text-shadow: 0 2px 0 #1b5e20, 0 4px 0 #14401a, 0 8px 18px rgba(0,0,0,.5);
}
.login-brand p {
  font-size: .82rem;
  opacity: .9;
  margin-top: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
}

/* wooden plank card */
.plank {
  position: relative;
  padding: 28px clamp(20px, 5vw, 32px) 30px;
  border-radius: 18px;
  background:
    repeating-linear-gradient(
      180deg,
      var(--wood-mid) 0px,
      var(--wood-mid) 26px,
      var(--wood-light) 27px,
      var(--wood-mid) 28px,
      var(--wood-mid) 54px,
      var(--wood-dark) 55px,
      var(--wood-mid) 56px
    );
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,.06),
    inset 0 2px 8px rgba(255,255,255,.12),
    inset 0 -4px 10px rgba(0,0,0,.4),
    0 16px 34px rgba(0,0,0,.5);
  border: 6px solid var(--wood-dark);
}
/* nail bolts in the four corners */
.plank::before,
.plank::after {
  content: "";
  position: absolute;
  width: 13px; height: 13px;
  background: radial-gradient(circle at 35% 30%, #d7b27a, #6b4a24 70%);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.6);
  top: 11px;
}
.plank::before { left: 11px; }
.plank::after  { right: 11px; }

.plank-title {
  text-align: center;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: var(--cream);
  text-shadow: 0 1px 0 #3a2410, 0 2px 4px rgba(0,0,0,.5);
  margin-bottom: 22px;
}

/* ===================== FIELDS ===================== */
.field {
  margin-bottom: 18px;
  animation: fadeUp .5s ease both;
}
.field:nth-of-type(1) { animation-delay: .15s; }
.field:nth-of-type(2) { animation-delay: .25s; }

.field label {
  display: block;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #ffe3a0;
  margin-bottom: 7px;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
}
.input-box .leading {
  position: absolute;
  left: 12px;
  display: flex;
  color: #9c6b38;
  pointer-events: none;
}
.input-box .leading svg { width: 20px; height: 20px; }

.field input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,.25);
  background: rgba(255, 248, 236, .95);
  color: #2a1a0c;
  font-size: .98rem;
  font-weight: 500;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.2);
  transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease;
}
.field input::placeholder { color: #9c7b5a; }
.field input:focus {
  border-color: var(--wood-dark);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.15), 0 0 0 4px rgba(194, 93, 46, 0.3);
}

/* password field has room for the eye button */
.field.password input { padding-right: 46px; }

.toggle-eye {
  position: absolute;
  right: 8px;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #7a4f27;
  cursor: pointer;
  border-radius: 8px;
  transition: color .2s ease, background .2s ease, transform .15s ease;
}
.toggle-eye:hover { color: var(--wood-dark); background: rgba(0,0,0,.08); }
.toggle-eye:active { transform: scale(.9); }
.toggle-eye svg { width: 22px; height: 22px; }
.toggle-eye .eye-off { display: none; }
.toggle-eye.is-on .eye-on  { display: none; }
.toggle-eye.is-on .eye-off { display: block; }

/* options row */
.row-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
  font-size: .82rem;
  animation: fadeUp .5s ease .3s both;
}
.row-opts .remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--cream);
}
.row-opts .remember input { width: 16px; height: 16px; accent-color: var(--green-1); }
.row-opts a {
  color: #ffe3a0;
  text-decoration: none;
}
.row-opts a:hover { text-decoration: underline; }

/* ===================== SUBMIT BUTTON (game UI) ===================== */
.btn-submit {
  --c1: var(--green-1);
  --c2: var(--green-2);
  position: relative;
  width: 100%;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #fff;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.3));
  transition: transform .15s ease, filter .15s ease;
  isolation: isolate;
  animation: fadeUp .5s ease .35s both;
}
.btn-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  border-radius: 12px;
  border-top: 2px solid rgba(255,255,255,.45);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 94% 100%, 0 100%);
}
.btn-submit span {
  display: block;
  padding: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 1.05rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.btn-submit:hover { transform: translateY(-3px) scale(1.015); filter: drop-shadow(0 9px 0 rgba(0,0,0,.32)); }
.btn-submit:active { transform: translateY(3px); filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }

/* small helper link below card */
.login-foot {
  text-align: center;
  margin-top: 16px;
  font-size: .82rem;
  animation: fadeUp .5s ease .4s both;
}
.login-foot a {
  color: #ffe3a0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.login-foot a:hover { text-decoration: underline; }

/* ===================== ANIMATIONS ===================== */
@keyframes cardIn { from { transform: translateY(30px) scale(.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 420px) {
  .login-brand h1 { font-size: 2.2rem; }
  .plank-title { font-size: 1.3rem; }
  .plank { padding: 24px 18px 26px; }
}
