/* doAttendance — Interactive product story */

.lp-story {
  position: relative;
  padding: 80px 0 40px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, transparent 40%);
}

.lp-story-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 48px;
  align-items: start;
}

.lp-story-sticky-wrap {
  position: sticky;
  top: calc(var(--lp-nav-h) + 24px);
}

.lp-story-stage {
  background: var(--lp-card);
  border: 1px solid var(--lp-border);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35);
}

.lp-story-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.lp-story-stage-head span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lp-dim);
}

.lp-story-scene-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lp-text);
}

.lp-story-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 12px;
}

.lp-story-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--lp-border);
  background: transparent;
  color: var(--lp-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.lp-story-tab.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--lp-text);
}

.lp-story-devices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.lp-story-device-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lp-dim);
  margin-bottom: 8px;
  text-align: center;
}

.lp-story-phone-frame,
.lp-story-admin-frame {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: 24px;
  border: 2px solid var(--lp-border);
  padding: 10px;
  min-height: 360px;
  position: relative;
  overflow: hidden;
}

.lp-story-phone-frame {
  max-width: 200px;
  margin-inline: auto;
}

.lp-story-phone-notch {
  width: 56px;
  height: 6px;
  background: #000;
  border-radius: 3px;
  margin: 0 auto 8px;
}

.lp-story-admin-frame {
  border-radius: 14px;
  padding: 12px;
  min-height: 360px;
  background: #0c1021;
}

.lp-scene-viewport {
  position: relative;
  min-height: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--lp-bg2);
}

.lp-scene {
  position: absolute;
  inset: 0;
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
  overflow-y: auto;
  font-size: 0.72rem;
}

.lp-scene.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 1;
}

.lp-scene.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lp-dim);
  font-size: 0.75rem;
}

/* Mock app UI primitives */
.lp-mock-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--lp-text);
}

.lp-mock-sub {
  font-size: 0.65rem;
  color: var(--lp-muted);
  margin: 0 0 10px;
}

.lp-mock-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--lp-border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.lp-mock-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--lp-border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--lp-muted);
  margin-bottom: 8px;
  font-size: 0.68rem;
}

.lp-mock-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.72rem;
  margin-top: 8px;
}

.lp-mock-btn-primary {
  background: var(--lp-green);
  color: #fff;
}

.lp-mock-btn-blue {
  background: var(--lp-blue);
  color: #fff;
}

.lp-mock-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  margin-bottom: 8px;
}

.lp-mock-badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.lp-mock-badge-warn {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.lp-mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--lp-border);
  font-size: 0.68rem;
}

.lp-mock-row:last-child {
  border-bottom: none;
}

.lp-mock-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--lp-green);
  position: relative;
  flex-shrink: 0;
}

.lp-mock-switch::after {
  content: '';
  position: absolute;
  right: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}

.lp-mock-switch.off {
  background: #475569;
}

.lp-mock-switch.off::after {
  right: auto;
  left: 3px;
}

/* Face auth UI */
.lp-face-scene {
  background: #0d1117;
  margin: -12px;
  padding: 12px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.lp-face-guide {
  text-align: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  margin-bottom: 10px;
}

.lp-face-step {
  font-size: 0.6rem;
  color: var(--lp-muted);
  letter-spacing: 0.04em;
}

.lp-face-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lp-text);
  margin-top: 4px;
}

.lp-face-sub {
  font-size: 0.62rem;
  color: var(--lp-muted);
  margin-top: 2px;
}

.lp-face-oval-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 140px;
}

.lp-face-oval {
  width: 100px;
  height: 130px;
  border: 3px solid rgba(99, 102, 241, 0.8);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.25);
  overflow: hidden;
  background: #1a1520;
}

.lp-face-illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: 0;
}

.lp-face-oval::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(16, 185, 129, 0.04));
  z-index: 1;
  pointer-events: none;
}

.lp-face-scan {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent);
  animation: lpScanLine 2s ease-in-out infinite;
  box-shadow: 0 0 8px #6366f1;
  z-index: 2;
}

.lp-face-warn {
  text-align: center;
  font-size: 0.58rem;
  color: #fcd34d;
  padding: 6px 8px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
  margin-top: 8px;
}

.lp-face-steps-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.lp-face-steps-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.lp-face-steps-dots span.on {
  background: #6366f1;
}

.lp-face-match {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--lp-green);
  animation: lpMatchPop 0.6s ease;
}

/* GPS ring */
.lp-gps-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
}

.lp-gps-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(16, 185, 129, 0.3);
  display: grid;
  place-items: center;
  position: relative;
}

.lp-gps-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.15);
  animation: lpPulseRing 2s ease-out infinite;
}

.lp-gps-ring-inner {
  font-size: 1.5rem;
}

.lp-gps-label {
  margin-top: 12px;
  text-align: center;
  font-weight: 600;
  color: var(--lp-green);
  font-size: 0.75rem;
}

/* Security layers */
.lp-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--lp-border);
  font-size: 0.65rem;
  transition: background 0.3s, border-color 0.3s;
}

.lp-layer.run {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
  animation: lpLayerPulse 1s ease infinite;
}

.lp-layer.done {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.lp-layer-icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.lp-layer-name {
  flex: 1;
  font-weight: 600;
}

.lp-layer-status {
  color: var(--lp-muted);
  font-size: 0.6rem;
}

/* Admin mini UI */
.lp-admin-header {
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lp-border);
}

.lp-admin-stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.lp-admin-stat {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.lp-admin-stat strong {
  display: block;
  font-size: 1rem;
  color: var(--lp-green);
}

.lp-admin-stat span {
  font-size: 0.58rem;
  color: var(--lp-muted);
}

.lp-admin-stat strong.animate-count {
  animation: lpCountPop 0.5s ease;
}

.lp-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6rem;
}

.lp-admin-table th,
.lp-admin-table td {
  padding: 6px 4px;
  text-align: left;
  border-bottom: 1px solid var(--lp-border);
}

.lp-admin-table th {
  color: var(--lp-dim);
  font-weight: 600;
}

.lp-admin-row-new {
  animation: lpRowSlide 0.6s ease;
  background: rgba(16, 185, 129, 0.08);
}

.lp-admin-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0 8px;
}

.lp-admin-bar span {
  display: block;
  height: 100%;
  background: var(--lp-gradient);
  border-radius: 3px;
  width: 0;
  transition: width 1s ease;
}

.lp-scene.active .lp-admin-bar span {
  width: var(--bar-w, 70%);
}

.lp-map-dot {
  height: 80px;
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
  border-radius: 8px;
  position: relative;
  margin-bottom: 8px;
  overflow: hidden;
}

.lp-map-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 12px,
    rgba(255, 255, 255, 0.03) 12px,
    rgba(255, 255, 255, 0.03) 13px
  );
}

.lp-map-pin {
  position: absolute;
  top: 35%;
  left: 55%;
  font-size: 1.2rem;
  animation: lpPinDrop 0.8s ease;
}

.lp-msg-bubble {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.62rem;
  animation: lpSlideIn 0.5s ease;
}

.lp-push-banner {
  background: linear-gradient(135deg, #1e40af, #4338ca);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  animation: lpSlideDown 0.5s ease;
  font-size: 0.65rem;
}

/* Story steps (scroll column) */
.lp-story-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lp-story-step {
  min-height: 55vh;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 0.4s ease;
  border-left: 2px solid transparent;
  padding-left: 28px;
  margin-left: 8px;
}

.lp-story-step.active {
  opacity: 1;
  border-left-color: var(--lp-blue);
}

.lp-story-step-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--lp-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.lp-story-step h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.lp-story-step p {
  margin: 0;
  color: var(--lp-muted);
  max-width: 480px;
  line-height: 1.7;
}

.lp-story-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.lp-story-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--lp-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--lp-text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.lp-story-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lp-story-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lp-story-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.lp-story-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.lp-story-dot.active {
  background: var(--lp-blue);
  transform: scale(1.2);
}

.lp-story-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.lp-story-progress span {
  display: block;
  height: 100%;
  background: var(--lp-gradient);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Hero auto-cycle */
.lp-hero-cycle {
  position: relative;
  min-height: 320px;
}

.lp-hero-cycle .lp-scene {
  padding: 16px;
}

.lp-hero-cycle .lp-scene-viewport {
  min-height: 320px;
  border-radius: 20px;
}

/* Keyframes */
@keyframes lpScanLine {
  0%, 100% { top: 15%; opacity: 0.3; }
  50% { top: 75%; opacity: 1; }
}

@keyframes lpPulseRing {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

@keyframes lpLayerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes lpMatchPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes lpCountPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: #34d399; }
  100% { transform: scale(1); }
}

@keyframes lpRowSlide {
  from { transform: translateX(-12px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes lpPinDrop {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes lpSlideIn {
  from { transform: translateX(12px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes lpSlideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-scene,
  .lp-story-step,
  .lp-face-scan,
  .lp-gps-ring::before,
  .lp-layer.run {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile */
@media (max-width: 960px) {
  .lp-story-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .lp-story-sticky-wrap {
    position: relative;
    top: 0;
  }

  .lp-story-tabs {
    display: flex;
  }

  .lp-story-devices {
    grid-template-columns: 1fr;
  }

  .lp-story-devices.show-phone .lp-story-admin-col {
    display: none;
  }

  .lp-story-devices.show-admin .lp-story-phone-col {
    display: none;
  }

  .lp-story-phone-frame {
    max-width: 220px;
  }

  .lp-story-step {
    min-height: 40vh;
    padding: 32px 0;
    padding-left: 16px;
    margin-left: 0;
  }

  .lp-story-step h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 600px) {
  .lp-story-phone-frame,
  .lp-story-admin-frame {
    min-height: 340px;
  }

  .lp-scene-viewport {
    min-height: 300px;
  }
}
