/* Nông Trại Vui Vẻ – trang Đăng nhập / Đăng ký */
:root {
  --g1: #7fd34a; --g2: #4aa52a; --g3: #2f7d1f; --g4: #1f5a14;
  --sun: #ffc93c; --ink: #26331f; --muted: #5d6b55; --line: #d9e6cc;
  --card: rgba(255, 255, 255, .88); --err: #b3261e; --ok: #2b8a2e; --focus: #2e7dd7;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.auth {
  font: 15px/1.5 "Nunito", "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink); background: #bfe3fb; min-height: 100vh;
  display: flex; padding: 70px 16px 30px; position: relative; overflow-x: hidden;
}

/* ------------------------------------------------ phông nền */
.scene { position: fixed; inset: 0; z-index: 0; }
.scene svg { width: 100%; height: 100%; display: block; }
.scene .drift { animation: drift 160s linear infinite; }
.scene .drift.s { animation-duration: 110s; }
.scene .drift.f { animation-duration: 70s; }
.scene .blades { transform-box: fill-box; transform-origin: center; animation: spin 16s linear infinite; }
.scene .bird { animation: fly 38s linear infinite; }
.scene .sunhalo { animation: pulse 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes drift { from { transform: translateX(-420px); } to { transform: translateX(1900px); } }
@keyframes fly { from { transform: translate(-80px, 0); } to { transform: translate(1800px, -60px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .8; } }

/* ------------------------------------------------ thẻ */
.card {
  position: relative; z-index: 1; width: 100%; max-width: 430px; margin: auto;
  background: var(--card); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
  border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 26px;
  box-shadow: 0 22px 60px rgba(20, 60, 20, .28), 0 2px 0 rgba(255, 255, 255, .7) inset;
  padding: 26px 28px 20px; animation: rise .55s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.brand { text-align: center; margin-bottom: 14px; }
.logo { width: 76px; height: 76px; margin: -52px auto 8px; border-radius: 50%; background: #fff; padding: 5px; box-shadow: 0 8px 20px rgba(30, 90, 20, .35); }
.logo svg { width: 100%; height: 100%; display: block; }
.brand h1 { margin: 0; font-size: 29px; line-height: 1.1; font-weight: 900; letter-spacing: -.01em; color: var(--g3); text-shadow: 0 2px 0 #fff; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }

.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #e9f2dd; border-radius: 14px; padding: 4px; margin: 14px 0 16px; }
.tabs .ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 11px; box-shadow: 0 2px 6px rgba(40, 80, 20, .18); transition: transform .28s cubic-bezier(.3, .8, .3, 1); }
.tabs[data-on="register"] .ind { transform: translateX(100%); }
.tabs button { position: relative; z-index: 1; border: 0; background: transparent; padding: 10px 6px; font: inherit; font-weight: 800; color: var(--muted); border-radius: 11px; cursor: pointer; transition: color .2s; }
.tabs button[aria-selected="true"] { color: var(--g3); }

.alert { display: flex; gap: 9px; align-items: flex-start; background: #fdecea; color: var(--err); border: 1px solid #f3b9b3; padding: 9px 12px; border-radius: 12px; margin: 0 0 14px; font-size: 14px; animation: shake .4s; }
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ------------------------------------------------ ô nhập */
form[hidden] { display: none; }
.fld { display: block; margin-bottom: 12px; }
.fld .lb { display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin: 0 0 4px 2px; }
.ctl { position: relative; display: block; }
.ctl .ico { position: absolute; left: 12px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: #8aa07a; pointer-events: none; transition: color .2s; }
.ctl input {
  display: block; width: 100%; padding: 11px 42px 11px 40px; font: inherit; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 13px; transition: border-color .2s, box-shadow .2s;
}
.ctl input::placeholder { color: #a8b69d; }
.ctl input:hover { border-color: #c4d8b0; }
.ctl input:focus { outline: none; border-color: var(--g2); box-shadow: 0 0 0 4px rgba(74, 165, 42, .18); }
.ctl:focus-within .ico { color: var(--g2); }
.ctl input:user-invalid { border-color: #e0827b; }
.ctl.ok input { border-color: #8ccf72; }
.eye { position: absolute; right: 5px; top: 50%; width: 34px; height: 34px; margin-top: -17px; border: 0; background: transparent; color: #7c9170; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.eye:hover { background: #eef5e6; color: var(--g3); }
.eye svg { width: 19px; height: 19px; }
.eye .off { display: none; } .eye[aria-pressed="true"] .on { display: none; } .eye[aria-pressed="true"] .off { display: block; }
.note { display: block; min-height: 17px; margin: 3px 0 0 3px; font-size: 12.5px; color: var(--muted); }
.note:empty { min-height: 0; margin: 0; }
.note.bad { color: var(--err); } .note.good { color: var(--ok); } .note.warn { color: #b26a00; }
.meter { display: block; height: 6px; background: #e4ecda; border-radius: 6px; margin: 7px 2px 0; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 6px; background: #e0827b; transition: width .25s, background .25s; }

.row { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 14px; gap: 10px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.chk input { width: 18px; height: 18px; accent-color: var(--g2); margin: 0; cursor: pointer; }

.go {
  position: relative; width: 100%; padding: 13px; font: inherit; font-weight: 900; font-size: 17px; letter-spacing: .01em; color: #fff; cursor: pointer;
  background: linear-gradient(#8bdc52, var(--g2)); border: 0; border-bottom: 4px solid var(--g4); border-radius: 14px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25); box-shadow: 0 8px 18px rgba(47, 125, 31, .35); transition: transform .08s, filter .2s;
}
.go:hover { filter: brightness(1.06); }
.go:active { transform: translateY(2px); border-bottom-width: 2px; }
.go.alt { background: linear-gradient(#ffb454, #e9822a); border-bottom-color: #a85a14; box-shadow: 0 8px 18px rgba(200, 110, 30, .35); }
.go[disabled] { filter: grayscale(.4) brightness(.95); cursor: progress; }
.go .sp { display: none; width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px; border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin2 .7s linear infinite; }
.go[disabled] .sp { display: inline-block; }
@keyframes spin2 { to { transform: rotate(360deg); } }

.foot { margin: 16px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.foot b { color: var(--g3); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3fc044; margin-right: 5px; box-shadow: 0 0 0 3px rgba(63, 192, 68, .2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ctl input:focus-visible { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 480px) {
  body.auth { padding: 62px 12px 20px; }
  .card { padding: 22px 18px 16px; border-radius: 22px; }
  .brand h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene .drift, .scene .blades, .scene .bird, .scene .sunhalo, .card, .alert { animation: none; }
  .tabs .ind, .ctl input, .meter i { transition: none; }
}
