/* Check-in action and sheet */
.location-widget {
  position: relative;
  z-index: 40;
}

.checkin-trigger,
.checkin-primary-button,
.checkin-secondary-button,
.checkin-text-button,
.checkin-nudge-action,
.checkin-sheet-close,
.checkin-nudge-close {
  font: inherit;
  cursor: pointer;
}

.checkin-trigger {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: auto;
  bottom: calc(72px + max(8px, env(safe-area-inset-bottom)));
  z-index: 40;
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: #04111e;
  font-weight: 800;
  white-space: nowrap;
  background: var(--accent-gradient);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow:
    var(--shadow),
    0 10px 30px rgba(0, 0, 0, 0.2);
  transform: none;
  transition:
    width var(--transition-fast),
    padding var(--transition-fast),
    border-radius var(--transition-fast),
    gap var(--transition-fast),
    transform var(--transition-fast),
    filter var(--transition-fast);
}

.checkin-trigger.is-intro {
  width: 160px;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
}

.checkin-trigger:hover,
.checkin-trigger:focus-visible {
  filter: brightness(1.08);
  outline: none;
  transform: translateY(-2px);
}

.checkin-trigger:active {
  transform: scale(0.97);
}

.checkin-trigger-logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.checkin-trigger-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checkin-trigger-fallback {
  display: none;
  font-size: 1.25rem;
  line-height: 1;
}

.checkin-trigger-label {
  flex: 0 0 auto;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-width var(--transition-fast),
    opacity var(--transition-fast);
}

.checkin-trigger.is-intro .checkin-trigger-label {
  max-width: 120px;
  opacity: 1;
}

.checkin-trigger-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  background: #22c55e;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.checkin-trigger.is-checked .checkin-trigger-badge {
  display: inline-flex;
}

.checkin-nudge {
  position: fixed;
  bottom: calc(140px + max(8px, env(safe-area-inset-bottom)));
  left: max(16px, env(safe-area-inset-left));
  right: auto;
  z-index: 41;
  width: min(360px, calc(100vw - 32px));
  padding: 16px 48px 16px 18px;
  color: var(--text);
  background: var(--card-strong, var(--card));
  border: 1px solid var(--border-accent);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transform: none;
  animation: checkinNudgeIn 0.35s ease-out;
}

.checkin-nudge-eyebrow,
.checkin-sheet-eyebrow,
.checkin-location-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkin-nudge-title {
  margin: 5px 0 12px;
  font-weight: 750;
}

.checkin-nudge-action {
  min-height: 38px;
  padding: 8px 13px;
  color: #04111e;
  font-weight: 800;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
}

.checkin-nudge-close,
.checkin-sheet-close {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 50%;
  place-items: center;
}

.checkin-nudge-close {
  top: 8px;
  right: 8px;
}

.checkin-sheet-close {
  top: 18px;
  right: 16px;
}

.checkin-nudge-close:hover,
.checkin-nudge-close:focus-visible,
.checkin-sheet-close:hover,
.checkin-sheet-close:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.checkin-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 17, 31, 0.78);
  backdrop-filter: blur(8px);
}

.checkin-sheet {
  position: relative;
  width: min(460px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow-y: auto;
  color: var(--text);
  background: var(--card-strong, var(--card));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: checkinSheetIn 0.25s ease-out;
}

.checkin-sheet-header {
  padding: 24px 58px 8px 24px;
}

.checkin-sheet-header h2 {
  margin: 5px 0 0;
  font-size: 1.35rem;
}

.checkin-sheet-content {
  padding: 16px 24px 28px;
}

.checkin-state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  color: #04111e;
  font-size: 1.55rem;
  font-weight: 900;
  background: var(--accent-gradient);
  border-radius: 16px;
  place-items: center;
}

.checkin-error-icon {
  color: #fff;
  background: #c94b4b;
}

.checkin-success-icon {
  color: #082414;
  background: #6ee7a7;
}

.checkin-sheet-lead,
.checkin-confirmation-copy,
.checkin-location-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.checkin-sheet-lead,
.checkin-confirmation-copy {
  margin-bottom: 20px;
}

.checkin-actions-stack {
  display: grid;
  gap: 10px;
}

.checkin-primary-button,
.checkin-secondary-button,
.checkin-text-button {
  min-height: 46px;
  padding: 11px 16px;
  font-weight: 750;
  border-radius: var(--radius-sm);
}

.checkin-primary-button {
  color: #04111e;
  background: var(--accent-gradient);
  border: 0;
}

.checkin-secondary-button {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-accent);
}

.checkin-text-button {
  color: var(--accent);
  background: transparent;
  border: 0;
}

.checkin-primary-button:hover,
.checkin-primary-button:focus-visible,
.checkin-secondary-button:hover,
.checkin-secondary-button:focus-visible,
.checkin-text-button:hover,
.checkin-text-button:focus-visible,
.checkin-nudge-action:hover,
.checkin-nudge-action:focus-visible {
  filter: brightness(1.1);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkin-loading {
  display: grid;
  min-height: 150px;
  color: var(--muted);
  text-align: center;
  place-content: center;
}

.checkin-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: checkinSpin 0.8s linear infinite;
}

.checkin-location-summary {
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
  background: rgba(125, 211, 252, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.checkin-location-pin {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 1.7rem;
}

.checkin-location-place,
.checkin-result-title {
  margin: 6px 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.checkin-location-meta {
  margin-top: 8px;
  font-size: 0.8rem;
}

.checkin-guide-link {
  display: inline-block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.checkin-error-message,
.checkin-form-error {
  color: #ff9b9b;
  text-align: center;
}

.checkin-error-message {
  margin: 0 0 20px;
}

.checkin-manual-form {
  display: grid;
  gap: 7px;
}

.checkin-manual-form label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.checkin-manual-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.checkin-manual-form input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(125, 211, 252, 0.22);
}

.checkin-form-error {
  min-height: 20px;
  margin: 2px 0;
  font-size: 0.85rem;
}

.checkin-sheet-open {
  overflow: hidden;
}

@keyframes checkinSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes checkinNudgeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes checkinSheetIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .checkin-trigger {
    bottom: calc(72px + max(8px, env(safe-area-inset-bottom)));
  }

  .checkin-nudge {
    bottom: calc(140px + env(safe-area-inset-bottom));
    width: min(320px, calc(100vw - 32px));
  }

  .checkin-sheet-overlay {
    align-items: end;
    padding: 0;
  }

  .checkin-sheet {
    width: 100%;
    max-height: min(82vh, 700px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    animation-name: checkinSheetUp;
  }
}

@keyframes checkinSheetUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkin-trigger,
  .checkin-nudge,
  .checkin-sheet,
  .checkin-spinner {
    animation: none;
    transition: none;
  }
}
