/* Pelican Loyalty v2.14: kiosk attention, phone registration feedback and instant local card preview. */

html:has(.kiosk-frame),
body:has(.kiosk-frame) {
  min-height: 100%;
  background: #fff;
}

.kiosk-frame {
  min-height: 100dvh;
}

.kiosk-open-home > .kiosk-open-hero .eyebrow {
  display: none !important;
}

.kiosk-speed-note {
  max-width: 560px;
  margin: 13px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: clamp(13px, 1.35vw, 16px);
  font-weight: 700;
  line-height: 1.4;
}

.kiosk-speed-note strong {
  color: var(--ink);
  font-weight: 900;
}

.kiosk-reward-preview > span,
.kiosk-reward-preview .reward-item > span,
.kiosk-reward-preview.reward-item > span {
  display: block;
  max-width: 15ch;
  font-family: var(--serif);
  font-size: clamp(18px, 1.75vw, 23px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
}

.kiosk-reward-preview > b,
.kiosk-reward-preview .reward-item > b,
.kiosk-reward-preview.reward-item > b {
  display: block;
  margin-top: 8px;
  font-size: clamp(13px, 1.1vw, 15px);
}

.kiosk-stampcard-visual.is-axis-turning .kiosk-stampcard-object {
  animation: kioskStampcardAxisTurn 1.72s cubic-bezier(.2, .82, .2, 1) both !important;
  will-change: transform;
}

@keyframes kioskStampcardAxisTurn {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotate(1.2deg) scale(1);
  }
  10% {
    transform: rotateX(-11deg) rotateY(0deg) rotate(1.2deg) scale(1.025);
  }
  48% {
    transform: rotateX(195deg) rotateY(0deg) rotate(.3deg) scale(.965);
  }
  76% {
    transform: rotateX(347deg) rotateY(0deg) rotate(1deg) scale(1.018);
  }
  90% {
    transform: rotateX(364deg) rotateY(0deg) rotate(1.2deg) scale(.995);
  }
  100% {
    transform: rotateX(360deg) rotateY(0deg) rotate(1.2deg) scale(1);
  }
}

/* A QR from the kiosk is a focused registration route: form first, no decorative card. */
.kiosk-qr-registration-entry .public-topbar,
.kiosk-qr-registration-entry .entry-switch,
.kiosk-qr-registration-entry .public-home-stampcard,
.kiosk-qr-registration-entry .public-home-details,
.kiosk-qr-entry .public-home-stampcard,
.kiosk-qr-public-home .public-home-details {
  display: none !important;
}

.kiosk-qr-registration-entry .public-home-shell,
.kiosk-qr-registration-entry .kiosk-qr-public-home {
  min-height: 100dvh;
}

.kiosk-qr-registration-entry .kiosk-qr-public-home {
  display: grid;
  place-items: start center;
  padding: 12px max(14px, env(safe-area-inset-right)) 30px max(14px, env(safe-area-inset-left));
}

.kiosk-qr-registration-entry .public-hero.kiosk-qr-entry {
  width: min(100%, 680px);
  margin: 0 auto;
}

.kiosk-qr-registration-entry .public-entry-card {
  box-shadow: 0 18px 52px rgba(5, 5, 5, .08);
}

#home-register-form {
  position: relative;
}

#home-register-form.is-creating-card {
  min-height: 520px;
  overflow: hidden;
}

.registration-create-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: clamp(28px, 7vw, 58px);
  border-radius: inherit;
  background: rgba(255, 255, 255, .985);
  text-align: center;
}

.registration-create-mark {
  position: relative;
  display: grid;
  width: 94px;
  height: 94px;
  place-items: center;
}

.registration-create-check {
  position: relative;
  z-index: 2;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #263167;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  transform: scale(0);
  animation: registrationCheckIn .54s .08s cubic-bezier(.18, .89, .32, 1.28) forwards;
}

.registration-create-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(38, 49, 103, .18);
  border-top-color: #263167;
  border-radius: 50%;
  animation: registrationRing 1.05s linear infinite;
}

.registration-create-copy h2 {
  max-width: 460px;
  margin: 8px auto 0;
  font-size: clamp(34px, 8vw, 52px);
  line-height: .98;
}

.registration-create-copy p {
  max-width: 420px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.registration-create-progress {
  width: min(100%, 330px);
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(38, 49, 103, .1);
}

.registration-create-progress span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: #263167;
  animation: registrationProgress 1.25s cubic-bezier(.65, 0, .35, 1) infinite;
}

.registration-create-overlay.is-success .registration-create-check {
  background: #0f6a43;
}

.registration-create-overlay.is-success .registration-create-ring {
  border-color: rgba(15, 106, 67, .16);
  border-top-color: #0f6a43;
}

.registration-create-overlay.is-existing .registration-create-ring {
  display: none;
}

.registration-create-error {
  margin: 12px 0 0;
  color: var(--danger, #b42318);
  font-weight: 800;
  line-height: 1.4;
}

@keyframes registrationCheckIn {
  0% { transform: scale(0) rotate(-12deg); }
  72% { transform: scale(1.1) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

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

@keyframes registrationProgress {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(85%); }
  100% { transform: translateX(250%); }
}

.card-cache-preview {
  min-height: 100dvh;
}

.card-cache-preview .customer-card-page {
  animation: none !important;
}

.card-cache-sync {
  position: fixed;
  z-index: 40;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 28px);
  padding: 10px 14px;
  border: 1px solid rgba(5, 5, 5, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(5, 5, 5, .12);
  backdrop-filter: blur(16px);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 850;
}

.card-cache-sync > span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid rgba(38, 49, 103, .2);
  border-top-color: #263167;
  border-radius: 50%;
  animation: cardCacheSync .78s linear infinite;
}

.card-cache-sync.is-offline > span {
  border: 0;
  background: #f0b34f;
  animation: none;
}

.card-cache-topbar .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.install-save-card .install-save-copy h2 {
  max-width: 760px;
}

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

@media (max-width: 760px) {
  #home-register-form.is-creating-card {
    min-height: 500px;
  }

  .registration-create-overlay {
    padding: 28px 20px;
  }

  .kiosk-reward-preview > span,
  .kiosk-reward-preview .reward-item > span,
  .kiosk-reward-preview.reward-item > span {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kiosk-stampcard-visual.is-axis-turning .kiosk-stampcard-object,
  .registration-create-check,
  .registration-create-ring,
  .registration-create-progress span,
  .card-cache-sync > span {
    animation: none !important;
  }

  .registration-create-check {
    transform: scale(1);
  }
}
