/* Tap-to-open — state styles must live here (not Tailwind-in-JS) so production CSS includes them */

.tap-to-open {
  display: flex;
  width: 100%;
  min-height: 4.25rem;
  touch-action: manipulation;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: none;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.tap-to-open:disabled {
  opacity: 1;
}

.tap-to-open[aria-disabled='true'] {
  pointer-events: none;
}

.tap-to-open:focus-visible {
  outline: 2px solid #174672;
  outline-offset: 2px;
}

.tap-to-open[data-state='idle'] {
  background-color: #174672;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgb(23 70 114 / 0.25);
  cursor: pointer;
}

.tap-to-open[data-state='idle']:hover {
  background-color: #0f2f4a;
}

.tap-to-open[data-state='idle']:active {
  transform: scale(0.98);
}

.tap-to-open[data-state='unlocking'] {
  background-color: #2b5a8a;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgb(23 70 114 / 0.25);
  cursor: wait;
  opacity: 1;
}

.tap-to-open[data-state='success'] {
  background-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgb(22 163 74 / 0.25);
  cursor: default;
}

.tap-to-open[data-state='error'] {
  background-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgb(245 158 11 / 0.25);
  cursor: pointer;
}

.tap-to-open[data-state='error']:active {
  transform: scale(0.98);
}

.tap-to-open[data-state='disabled'] {
  background-color: #e2e5ff;
  color: #2c3e5c;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.tap-to-open__spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgb(255 255 255 / 0.3);
  border-top-color: #ffffff;
  border-radius: 9999px;
  animation: tap-to-open-spin 0.7s linear infinite;
}

@keyframes tap-to-open-spin {
  to {
    transform: rotate(360deg);
  }
}

.tap-to-open-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.tap-to-open-error {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #92400e;
}

.tap-to-open-error.hidden {
  display: none;
}
