/* Work-order stamp reveal — login page */

.login-panel.login-panel--stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 40px 44px;
  overflow: hidden;
}

.stamp-scene {
  position: relative;
  width: 100%;
  max-width: 380px;
  min-height: 360px;
  display: grid;
  place-items: center;
}

/* Work order sheet */
.wo-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  padding: 22px 22px 26px;
  background: #fff;
  border: 1px solid rgba(214, 211, 209, 0.95);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 28px rgba(28, 25, 23, 0.08),
    2px 3px 0 rgba(168, 162, 158, 0.15);
  transform: rotate(-1.5deg);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-panel--stamping .wo-sheet {
  animation: sheetImpact 0.35s ease 0.55s;
}

.login-panel--ready .wo-sheet {
  opacity: 0;
  transform: rotate(-1.5deg) scale(0.92) translateY(12px);
  pointer-events: none;
}

@keyframes sheetImpact {
  0%,
  100% {
    transform: rotate(-1.5deg);
  }
  40% {
    transform: rotate(-1.5deg) scale(0.985) translateY(2px);
  }
}

.wo-sheet__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid #1c1917;
}

.wo-sheet__tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1c1917;
}

.wo-sheet__no {
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #78716c;
}

.wo-sheet__task {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #292524;
}

.wo-sheet__fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.72rem;
  color: #57534e;
}

.wo-sheet__fields span:nth-child(odd) {
  font-weight: 700;
  color: #a8a29e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.62rem;
}

.wo-sheet__pending {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px dashed #d6d3d1;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a8a29e;
  text-align: center;
  transition: opacity 0.25s ease;
}

.login-panel--stamping .wo-sheet__pending,
.login-panel--ready .wo-sheet__pending {
  opacity: 0;
}

.wo-stamp-mark {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translate(-50%, 50%) scale(1.4) rotate(-12deg);
  opacity: 0;
  padding: 8px 18px;
  border: 3px solid #b91c1c;
  border-radius: 6px;
  color: #b91c1c;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.wo-stamp-mark span {
  display: block;
  opacity: 0.88;
}

.login-panel--stamping .wo-stamp-mark {
  animation: stampInk 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.62s forwards;
}

.login-panel--ready .wo-stamp-mark {
  opacity: 0;
}

@keyframes stampInk {
  0% {
    opacity: 0;
    transform: translate(-50%, 50%) scale(1.8) rotate(-12deg);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, 50%) scale(0.92) rotate(-12deg);
  }
  100% {
    opacity: 0.92;
    transform: translate(-50%, 50%) scale(1) rotate(-12deg);
  }
}

/* Rubber stamp tool */
.stamp-tool {
  position: absolute;
  z-index: 3;
  top: -80px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.login-panel--stamping .stamp-tool {
  opacity: 1;
  animation: stampDrop 0.75s cubic-bezier(0.55, 0.06, 0.2, 1) forwards;
}

.login-panel--ready .stamp-tool {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes stampDrop {
  0% {
    top: -80px;
    transform: translateX(-50%) rotate(8deg);
  }
  70% {
    top: 38%;
    transform: translateX(-50%) rotate(-4deg);
  }
  82% {
    top: 36%;
    transform: translateX(-50%) rotate(-2deg) scale(0.98);
  }
  100% {
    top: -120px;
    transform: translateX(-50%) rotate(0deg);
    opacity: 0;
  }
}

.stamp-tool__handle {
  width: 14px;
  height: 36px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(90deg, #78716c, #a8a29e 45%, #78716c);
  box-shadow: 0 2px 4px rgba(28, 25, 23, 0.2);
}

.stamp-tool__face {
  width: 52px;
  height: 52px;
  margin-top: -2px;
  border-radius: 50%;
  background: linear-gradient(145deg, #dc2626, #991b1b);
  border: 3px solid #7f1d1d;
  box-shadow:
    0 4px 12px rgba(185, 28, 28, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

/* Trigger button */
.stamp-trigger {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  padding: 12px 20px;
  border: 1px solid rgba(214, 211, 209, 0.95);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #fafaf9 100%);
  color: #44403c;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

.stamp-trigger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.12);
}

.stamp-trigger:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
}

.stamp-trigger:disabled {
  opacity: 0;
  pointer-events: none;
}

.stamp-trigger__icon {
  width: 20px;
  height: 20px;
  color: #b91c1c;
}

.login-panel--stamping .stamp-trigger,
.login-panel--ready .stamp-trigger {
  opacity: 0;
  pointer-events: none;
}

/* Login card */
.login-panel--stamp .login-card {
  position: absolute;
  inset: 0;
  z-index: 4;
  margin: auto;
  width: calc(100% - 8px);
  max-width: 360px;
  height: fit-content;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96) translateY(10px);
  pointer-events: none;
}

.login-panel--ready .login-card {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  animation: loginUnfold 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes loginUnfold {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wo-sheet,
  .wo-stamp-mark,
  .stamp-tool,
  .stamp-trigger,
  .login-card {
    animation: none !important;
    transition: none !important;
  }

  .login-panel--ready .wo-sheet,
  .login-panel--ready .stamp-tool,
  .login-panel--ready .stamp-trigger {
    opacity: 0;
    pointer-events: none;
  }

  .login-panel--ready .login-card {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
}

@media (max-width: 800px) {
  .login-panel.login-panel--stamp {
    padding: 28px 22px 36px;
  }

  .stamp-scene {
    min-height: 340px;
  }

  .wo-sheet {
    max-width: 100%;
    padding: 18px 18px 22px;
  }

  .stamp-trigger {
    margin-top: 22px;
    width: 100%;
    max-width: 280px;
  }
}
