.auth { position: relative; overflow: auto; min-height: 100dvh; padding: 18px 20px 26px; gap: 16px; }
.auth h1 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.08; color: var(--forest); }
.auth h1 em { font-weight: 500; color: var(--leaf); }
.auth p { margin: 0; }
.blob-auth { position: absolute; border-radius: 50%; background: var(--leaf-tint); pointer-events: none; }
.blob-auth--a { top: -100px; right: -90px; width: 260px; height: 260px; }
.blob-auth--b { bottom: 120px; left: -90px; width: 240px; height: 240px; background: var(--sun-tint); }

.icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(30, 60, 40, 0.1); display: flex; align-items: center; justify-content: center; }
.icon-btn--glass { background: rgba(255, 255, 255, 0.18); box-shadow: none; }
.step-row { position: relative; display: flex; align-items: center; justify-content: space-between; }
.step-label { font-size: 14px; font-weight: 800; color: var(--muted); }
.progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.progress i { height: 6px; border-radius: 3px; background: var(--switch-off); }
.progress i.is-on { background: var(--leaf); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .auth legend { font-size: 14px; font-weight: 800; }
.auth legend { padding: 0; margin-bottom: 8px; }
.auth fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; }
.auth input[type="email"],
.auth input[type="text"],
.auth input[type="password"],
.login-form input[type="email"],
.login-form input[type="password"] {
  min-height: 52px;
  width: 100%;
  border-radius: 16px;
  border: 1.5px solid #D9E2D0;
  background: #fff;
  padding: 0 16px;
  font-size: 16px;
  color: var(--ink);
}
.auth input::placeholder, .login-form input::placeholder { color: #8A958B; }
.auth input:focus, .login-form input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(62, 138, 82, 0.18); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; }
.field-head a, .text-link { font-size: 14px; font-weight: 800; color: var(--forest); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 76px; }
.show-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--line); color: var(--forest); font-size: 13px; font-weight: 800; cursor: pointer; }
.checks { display: flex; gap: 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
.check { display: flex; align-items: center; gap: 5px; }
.check svg { opacity: 0.35; }
.check.is-met { color: var(--leaf-text); }
.check.is-met svg { opacity: 1; }
.agree { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; color: #4E5A51; cursor: pointer; }
.agree input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--forest); }
.agree a { font-weight: 800; color: var(--forest); }
.form-error { min-height: 0; margin: 0; font-size: 14px; font-weight: 700; color: var(--bark-text); }
.form-error:empty { display: none; }

.btn-forest {
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--forest);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(31, 77, 58, 0.25);
}
.btn-forest:disabled, .btn-forest.is-off {
  background: var(--switch-off);
  color: var(--muted);
  box-shadow: none;
  cursor: default;
}
.btn-ghost {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-line {
  min-height: 52px;
  border-radius: 16px;
  border: 1.5px solid #D9E2D0;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.fine { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.fine a { font-weight: 800; color: var(--forest); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }

.login-hero { position: relative; height: 210px; flex-shrink: 0; border-radius: 0 0 36px 36px; overflow: hidden; }
.login-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.login-hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 20, 12, 0.8) 0%, rgba(8, 20, 12, 0.35) 60%, rgba(8, 20, 12, 0.1) 100%); }
.login-hero .inner { position: relative; padding: 18px 20px; display: flex; flex-direction: column; gap: 22px; }
.login-top { display: flex; align-items: center; gap: 12px; }
.login-name { color: #fff; font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.login-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.login-brand h1 { color: #fff; font-size: 34px; }
.login-brand em { font-weight: 600; color: #fff; }
.login-form, .socials, .create { position: relative; padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
.login-form { padding-top: 22px; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.or span { flex: 1; height: 1px; background: #D9E2D0; }
.socials .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.create { margin-top: auto; padding-bottom: 28px; }
.create a {
  min-height: 64px;
  border-radius: 22px;
  background: var(--leaf-tint);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.create small { display: block; font-size: 14px; color: #3F5245; }
.create strong { display: block; font-size: 16px; color: var(--forest); }
.create .leaf {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
}

.note {
  border-radius: 20px; padding: 12px 14px; background: #fff;
  box-shadow: 0 8px 22px rgba(30, 60, 40, 0.07);
  display: flex; align-items: flex-start; gap: 12px;
}
.note p { font-size: 14px; line-height: 1.45; color: #3F5245; }
.note-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--leaf-tint);
  display: flex; align-items: center; justify-content: center;
}
.dots { display: flex; gap: 16px; }
.dot {
  width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box;
  border: 2.5px solid #A7B3A3; background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.dot.is-on { background: var(--forest); border-color: var(--forest); }
.dot.is-saved { background: var(--leaf); border-color: var(--leaf); }
.dots.is-shake { animation: shake 0.4s ease; }
.pin-status { min-height: 20px; font-size: 14px; font-weight: 800; color: var(--leaf-text); text-align: center; }
.pin-status.is-bad { color: var(--bark-text); }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; padding: 0 12px; }
.key {
  height: 58px; border: 0; border-radius: 20px; background: #fff;
  box-shadow: 0 4px 12px rgba(30, 60, 40, 0.08);
  font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.key:active { transform: scale(0.94); background: var(--leaf-tint); }
.key--quiet { background: transparent; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.key:disabled { opacity: 0.35; cursor: default; }
.pad--sheet { padding: 0 8px; }
.pad--sheet .key { height: 56px; background: var(--bg); box-shadow: none; }
.pad--sheet .key--quiet { background: transparent; }

.swatches { display: flex; gap: 12px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(30, 60, 40, 0.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--forest); }
.devices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip-device {
  min-height: 52px; border-radius: 16px; border: 1.5px solid #D9E2D0; background: #fff;
  color: var(--ink); font-size: 15px; font-weight: 800; cursor: pointer;
}
.chip-device[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.preview-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(30, 60, 40, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 40px; font-weight: 600;
}

.steps-card {
  margin: 0; padding: 4px 16px; list-style: none; border-radius: 24px; background: #fff;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.steps-card li { display: flex; align-items: center; gap: 12px; padding: 14px 0; font-size: 15px; line-height: 1.4; }
.steps-card li + li { border-top: 1px solid var(--line); }
.num {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--leaf-tint);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--forest);
}
.code-card {
  border-radius: 24px; padding: 18px; background: var(--forest); color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.code-card strong { font-family: var(--serif); font-size: 44px; font-weight: 600; letter-spacing: 0.12em; }
.copy-code {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.wait { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font-size: 15px; font-weight: 700; color: var(--muted); }
.pulse { display: flex; gap: 5px; }
.pulse i { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); animation: pulse 1.2s ease-in-out infinite; }
.pulse i:nth-child(2) { animation-delay: 0.2s; }
.pulse i:nth-child(3) { animation-delay: 0.4s; }
.connected {
  border-radius: 22px; padding: 14px 16px; background: var(--leaf-tint); color: var(--forest);
  display: flex; align-items: center; gap: 12px; font-weight: 800;
}
.connected span { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }

.pin-dim { position: fixed; inset: 0; background: rgba(12, 28, 18, 0.55); z-index: 20; }
.pin-dim[hidden], .pin-sheet[hidden] { display: none !important; }
.pin-sheet {
  position: fixed; left: 50%; top: 6vh; transform: translateX(-50%);
  width: min(390px, calc(100% - 28px)); max-height: calc(100dvh - 8vh); overflow: auto; z-index: 21;
  border-radius: 32px; background: #fff; padding: 10px 22px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; gap: 14px;
  animation: sheet 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.pin-handle { display: flex; align-items: center; justify-content: center; position: relative; min-height: 44px; }
.pin-handle i { width: 44px; height: 5px; border-radius: 3px; background: var(--switch-off); }
.pin-close {
  position: absolute; right: -6px; top: 0; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pin-copy { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pin-lock {
  width: 56px; height: 56px; border-radius: 50%; background: var(--leaf-tint);
  display: flex; align-items: center; justify-content: center;
}
.pin-copy h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--forest); }
.pin-copy h2 em { font-weight: 500; }
.pin-copy p { margin: 0; font-size: 15px; line-height: 1.45; color: #4E5A51; }
.pin-success { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 12px 0 8px; }
.pin-burst { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.pin-burst i {
  position: absolute; inset: 8px; border-radius: 50%; border: 3px solid var(--leaf);
  animation: ring-out 1.6s ease-out infinite;
}
.pin-burst b {
  width: 72px; height: 72px; border-radius: 50%; background: var(--leaf);
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.pin-success .btn-forest { width: 100%; margin-top: 8px; }

@keyframes sheet { from { transform: translate(-50%, 100%); } to { transform: translateX(-50%); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
@keyframes ring-out { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.7); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .rise, .pin-sheet, .dots.is-shake, .pulse i, .pin-burst i, .pin-burst b, .spinner { animation: none; }
}
