/* Login robot — standalone file (do not combine with auth.css) */
:root {
  --ink: #1e293b;
  --accent: #0f766e;
  --accent-deep: #115e59;
  --teal: #14b8a6;
  --yellow: #f59e0b;
  --shell: #ffffff;
  --screen: #0b3d34;
  --eye: #f8fafc;
  --muted: #64748b;
  --line: 2px solid var(--ink);
  --turn: .65s cubic-bezier(.5, -0.3, .25, 1.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.auth-robot-page {
  min-height: 100%;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: #eef2f7;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* ===== Mobile-first scene (app screen) ===== */
.scene {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  background:
    radial-gradient(rgba(15, 118, 110, .08) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
    linear-gradient(165deg, #f3f4f8 0%, #e8eef2 55%, #e6f7f4 100%);
}

.stage {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 36px;   /* bubble + antenna */
  padding-bottom: 30px; /* feet below card */
}

/* robot */
.robot {
  position: relative;
  z-index: 1;
  margin-bottom: -18px;
  perspective: 800px;
}

.antenna {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.antenna-rod {
  width: 3px;
  height: 18px;
  background: var(--ink);
  border-radius: 2px;
}
.antenna-tip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: var(--line);
  order: -1;
  margin-bottom: -2px;
  position: relative;
}
.antenna-tip::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
}
.robot[data-mood="excited"] .antenna-tip { background: var(--yellow); }
.robot[data-mood="success"] .antenna-tip { background: var(--teal); }

.head3d {
  width: 112px;
  height: 102px;
  perspective: 700px;
  transform-style: preserve-3d;
  transform:
    translateY(var(--hy, 0px))
    scale(var(--hsc, 1))
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out;
  will-change: transform;
}
.is-hyped .head3d { --hy: 4px; --hsc: 1.03; }
.is-pressed .head3d { --hy: 7px; --hsc: .95; }

.head {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--turn);
}
.is-turned .head { transform: rotateY(180deg); }
.is-spinning .head { animation: victory .9s ease-in-out; }
@keyframes victory { to { transform: rotateY(360deg); } }

.ear {
  position: absolute;
  top: 34px;
  width: 12px;
  height: 30px;
  background: var(--shell);
  border: var(--line);
  border-radius: 7px;
}
.ear--l { left: -8px; }
.ear--r { right: -8px; }

.face {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--shell);
  border: var(--line);
}
.face--front { box-shadow: 4px 5px 0 rgba(15, 118, 110, .16); }
.face--back {
  box-shadow: 4px 5px 0 rgba(15, 118, 110, .16);
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
}

.visor {
  position: absolute;
  inset: 16px 12px 14px;
  background: var(--screen);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}

.eyes {
  display: flex;
  gap: 20px;
  transform: translate(var(--lx, 0px), var(--ly, 0px));
  transition: transform .18s ease-out;
}
.eyes.blink .eye { transform: scaleY(.08); }

.eye {
  width: 14px;
  height: 18px;
  border-radius: 7px;
  background: var(--eye);
  transition: all .22s ease;
}

[data-mood="happy"] .eye,
[data-mood="success"] .eye {
  width: 18px;
  height: 9px;
  background: transparent;
  border: 4px solid var(--eye);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
}
[data-mood="excited"] .eye {
  transform: scale(1.15);
  border-radius: 50%;
  height: 16px;
}
[data-mood="pressed"] .eye {
  width: 18px;
  height: 9px;
  background: transparent;
  border: 4px solid var(--eye);
  border-top: none;
  border-radius: 0 0 18px 18px;
}

.cheek {
  position: absolute;
  top: 58%;
  width: 11px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .3s ease;
}
.cheek--l { left: 12px; }
.cheek--r { right: 12px; }
[data-mood="happy"] .cheek,
[data-mood="excited"] .cheek,
[data-mood="pressed"] .cheek,
[data-mood="success"] .cheek { opacity: .9; }

.mouth {
  width: 12px;
  height: 4px;
  border-radius: 3px;
  background: var(--eye);
  transition: all .25s ease;
}
[data-mood="watching"] .mouth { width: 7px; height: 7px; border-radius: 50%; }
[data-mood="happy"] .mouth { width: 22px; height: 9px; border-radius: 0 0 12px 12px; }
[data-mood="excited"] .mouth { width: 18px; height: 12px; border-radius: 0 0 10px 10px; }
[data-mood="pressed"] .mouth { width: 20px; height: 11px; border-radius: 0 0 11px 11px; }
[data-mood="success"] .mouth { width: 28px; height: 13px; border-radius: 0 0 14px 14px; }

.panel {
  width: 88px;
  padding: 8px 7px;
  background: var(--screen);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.panel-lights { display: flex; gap: 5px; }
.panel-lights i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.panel-lights i:nth-child(2) { background: var(--yellow); }
.panel-lights i:nth-child(3) { background: var(--teal); }

.meter { display: flex; gap: 4px; }
.meter i {
  width: 11px;
  height: 15px;
  border-radius: 3px;
  background: #1a4d44;
  transition: background .25s ease;
}
.meter[data-lvl="1"] i.on { background: #f87171; }
.meter[data-lvl="2"] i.on { background: #fb923c; }
.meter[data-lvl="3"] i.on { background: var(--yellow); }
.meter[data-lvl="4"] i.on { background: var(--teal); }

.panel-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #e6f7f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--shell);
  border: var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding: 7px 11px;
  border-radius: 11px;
  width: max-content;
  max-width: 210px;
  text-align: center;
  box-shadow: 2px 2px 0 rgba(15, 118, 110, .28);
  z-index: 3;
}
.bubble::after {
  content: '';
  position: absolute;
  top: calc(100% - 4px);
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--shell);
  border-right: var(--line);
  border-bottom: var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.bubble.pop { animation: pop .28s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop {
  from { transform: translateX(-50%) scale(.85); }
  to   { transform: translateX(-50%) scale(1); }
}

/* form card */
.card {
  position: relative;
  z-index: 2;
  width: 100%;
  background: #fff;
  border: var(--line);
  border-radius: 18px;
  padding: 26px 18px 30px;
  box-shadow: 5px 6px 0 rgba(15, 118, 110, .22);
  overflow: visible;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 800;
  font-size: .88rem;
  margin-bottom: 6px;
}

.brand-slv {
  gap: 8px;
  margin-bottom: 10px;
}

.brand-icon {
  height: 48px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-slv-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.brand-short {
  display: inline-block;
  border: 2px solid #111;
  padding: 3px 10px;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #111;
  line-height: 1.1;
}

.brand-name {
  font-size: .68rem;
  font-weight: 800;
  color: #14532d;
  text-align: center;
  line-height: 1.3;
  max-width: 11rem;
}

.hand {
  position: absolute;
  top: -14px;
  width: 40px;
  height: 28px;
  display: block;
  background:
    linear-gradient(90deg, transparent 31%, rgba(30, 41, 59, .85) 32%, rgba(30, 41, 59, .85) 36%, transparent 37%, transparent 63%, rgba(30, 41, 59, .85) 64%, rgba(30, 41, 59, .85) 68%, transparent 69%) 0 10px / 100% calc(100% - 10px) no-repeat,
    var(--shell);
  border: var(--line);
  border-radius: 8px 8px 12px 12px;
  z-index: 4;
  pointer-events: none;
}
.hand--l { left: 28px; }
.hand--r { right: 28px; }

.foot {
  position: absolute;
  bottom: -24px;
  width: 48px;
  height: 28px;
  display: block;
  background: var(--shell);
  border: var(--line);
  border-radius: 8px 8px 12px 12px;
  box-shadow: inset 0 -7px 0 rgba(15, 118, 110, .1);
  z-index: 0;
  pointer-events: none;
}
.foot--l { left: 48px; }
.foot--r { right: 48px; }

.title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  margin: 0 0 14px;
}

.auth-note {
  font-size: .8rem;
  font-weight: 700;
  padding: 9px 11px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 2px solid var(--ink);
}
.auth-note--ok {
  background: #ecfdf5;
  color: #065f46;
}
.auth-note--err {
  background: #fef2f2;
  color: #991b1b;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 12px;
  margin-bottom: 10px;
  background: #ffffff !important;
  border: 2px solid rgba(30, 41, 59, .16);
  border-radius: 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
  cursor: text;
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 rgba(15, 118, 110, .28);
  background: #ffffff !important;
}
.field-icon {
  width: 18px;
  height: 18px;
  fill: var(--muted);
  flex: none;
  z-index: 1;
}
.field:focus-within .field-icon { fill: var(--accent); }

.field input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  background-color: transparent !important;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  font-weight: 700;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}
.field input::placeholder {
  color: var(--muted);
  font-weight: 600;
  -webkit-text-fill-color: var(--muted);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  transition: background-color 99999s ease-in-out 0s;
  border: 0 !important;
}

.peek {
  border: 0;
  background: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.peek svg { width: 18px; height: 18px; fill: var(--muted); }
.peek[aria-pressed="true"] svg,
.peek:hover svg { fill: var(--ink); }

.form-meta {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 10px;
}
.meta-link {
  font-size: .8rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}

.btn {
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 2px;
  border: var(--line);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 3px 4px 0 rgba(15, 61, 52, .4);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.btn:active {
  transform: translate(2px, 3px);
  box-shadow: 0 0 0 rgba(15, 61, 52, .4);
}
.btn.is-loading { opacity: .92; pointer-events: none; }
.btn.is-success { background: var(--teal); }

.btn-bolt {
  display: none;
}

.card.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* Short phones — keep hands + feet, shrink head only */
@media (max-height: 700px) {
  .bubble { display: none; }
  .stage { padding-top: 18px; padding-bottom: 28px; }
  .robot { margin-bottom: -14px; }
  .head3d { width: 96px; height: 88px; }
  .antenna { top: -22px; }
  .card { padding: 20px 16px 24px; }
  .title { margin-bottom: 10px; font-size: 1.05rem; }
  .field { height: 46px; margin-bottom: 8px; }
  .btn { height: 46px; }
  .hand {
    display: block !important;
    top: -12px;
    width: 36px;
    height: 24px;
  }
  .foot {
    display: block !important;
    bottom: -22px;
    height: 24px;
    width: 44px;
  }
}

/* Very short phones — still show limbs */
@media (max-height: 600px) {
  .stage { padding-top: 12px; padding-bottom: 26px; }
  .head3d { width: 84px; height: 76px; }
  .robot { margin-bottom: -12px; }
  .brand-row { margin-bottom: 2px; }
  .title { margin-bottom: 8px; }
  .card { padding: 16px 14px 18px; }
  .hand {
    display: block !important;
    top: -11px;
    width: 34px;
    height: 22px;
  }
  .hand--l { left: 24px; }
  .hand--r { right: 24px; }
  .foot {
    display: block !important;
    bottom: -20px;
    width: 42px;
    height: 22px;
  }
  .foot--l { left: 40px; }
  .foot--r { right: 40px; }
}

/* Tablet / desktop polish */
@media (min-width: 768px) {
  .scene {
    padding: 40px 24px;
  }

  .stage { max-width: 380px; }

  .robot {
    margin-bottom: -16px;
    animation: float 4s ease-in-out infinite alternate;
  }

  @keyframes float {
    from { transform: translateY(0); }
    to   { transform: translateY(-5px); }
  }

  .antenna { top: -32px; }
  .antenna-rod { width: 4px; height: 22px; }
  .antenna-tip { width: 15px; height: 15px; animation: bob 2.4s ease-in-out infinite; }
  @keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2.5px); }
  }

  .head3d { width: 152px; height: 140px; }
  .ear { top: 48px; width: 16px; height: 40px; border-radius: 8px; }
  .ear--l { left: -10px; }
  .ear--r { right: -10px; }
  .face { border-radius: 34px; }
  .visor { inset: 22px 16px 20px; border-radius: 22px; gap: 13px; }
  .eyes { gap: 28px; }
  .eye { width: 19px; height: 25px; border-radius: 9px; }
  .panel { width: 116px; padding: 12px 10px 10px; }
  .bubble {
    font-size: 13px;
    max-width: 250px;
    padding: 9px 14px;
    bottom: calc(100% + 16px);
  }

  .card {
    padding: 36px 28px 40px;
    box-shadow: 8px 9px 0 rgba(15, 118, 110, .28);
  }
  .hand { top: -16px; width: 44px; height: 32px; }
  .hand--l { left: 36px; }
  .hand--r { right: 36px; }
  .foot { bottom: -26px; width: 54px; height: 34px; }
  .foot--l { left: 62px; }
  .foot--r { right: 62px; }
  .title { font-size: 1.25rem; margin-bottom: 20px; }
  .field { height: 52px; margin-bottom: 14px; padding: 0 14px; }
  .btn { height: 54px; }
  .btn-bolt {
    display: inline-block;
    opacity: 0;
    transform: translateX(-10px) scale(.4);
    transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
  }
  .btn:hover .btn-bolt,
  .btn:focus-visible .btn-bolt {
    opacity: 1;
    transform: none;
  }
  .btn:hover, .btn:focus-visible {
    transform: translate(-2px, -2px);
    background: var(--accent-deep);
    box-shadow: 7px 8px 0 rgba(15, 61, 52, .45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .robot { animation: none !important; }
  .antenna-tip { animation: none !important; }
  .head { transition-duration: .01s; }
  .is-spinning .head { animation: none; }
  .bubble.pop { animation: none; }
  .eyes { transition: none; }
}
