/* Public attendance — modern face-kiosk UI */

.att-body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: #f2f6fa;
  background: #071016;
  overflow-x: hidden;
}

.att-body::before {
  display: none;
}

.att-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.att-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
  filter: saturate(1.05) brightness(0.72) contrast(1.05);
  animation: att-drift 30s ease-in-out infinite alternate;
}

.att-bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 14, 24, 0.72) 0%, rgba(4, 14, 24, 0.38) 45%, rgba(4, 14, 24, 0.82) 100%),
    radial-gradient(ellipse 55% 50% at 50% 70%, rgba(13, 159, 138, 0.18), transparent 70%);
}

.att-bg-glow {
  position: absolute;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  top: -8%;
  left: 50%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 159, 138, 0.28), transparent 68%);
  filter: blur(12px);
  animation: att-breathe 6s ease-in-out infinite;
}

@keyframes att-drift {
  from { transform: scale(1.08) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.2%, -1%, 0); }
}

@keyframes att-breathe {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.att-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 1rem 1.05rem 1.5rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: rise 0.55s ease both;
}

.att-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.att-nav-link {
  color: rgba(242, 246, 250, 0.72);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.att-nav-link:hover {
  color: #fff;
  background: rgba(13, 159, 138, 0.18);
  border-color: rgba(13, 159, 138, 0.4);
}

.att-hero {
  text-align: center;
  margin-bottom: 1.15rem;
  animation: rise 0.65s ease both 0.05s;
}

.att-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
  color: #fff;
  text-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.att-lead {
  margin: 0.55rem 0 0;
  color: rgba(242, 246, 250, 0.7);
  font-size: clamp(0.92rem, 2.5vw, 1.05rem);
  font-weight: 500;
}

.att-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  min-height: 0;
}

.att-stage-wrap {
  position: relative;
  animation: att-pop 0.7s ease both 0.12s;
}

@keyframes att-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.att-stage {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(58vh, 520px);
  margin: 0 auto;
  border-radius: 28px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(13, 159, 138, 0.15);
  overflow: hidden;
}

.att-stage .stage-status {
  cursor: default;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.att-stage .stage-status[data-clickable="1"] {
  cursor: pointer;
  background: rgba(13, 159, 138, 0.72);
  border-color: rgba(94, 234, 212, 0.35);
  box-shadow: 0 8px 22px rgba(13, 159, 138, 0.28);
}

.att-stage .stage-status[data-clickable="1"]:hover {
  background: rgba(13, 159, 138, 0.88);
  transform: translateX(-50%) scale(1.03);
}

.att-stage .stage-status[data-clickable="1"]:active {
  transform: translateX(-50%) scale(0.98);
}

.att-scan {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  top: 18%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.85), transparent);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.55);
  animation: att-scan 3.2s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes att-scan {
  0% { top: 16%; opacity: 0; }
  15% { opacity: 0.85; }
  85% { opacity: 0.85; }
  100% { top: 78%; opacity: 0; }
}

.att-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(8, 16, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  animation: rise 0.7s ease both 0.18s;
}

.identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.identity.matched {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(13, 159, 138, 0.18);
  box-shadow: 0 0 0 1px rgba(13, 159, 138, 0.2), 0 12px 32px rgba(13, 159, 138, 0.2);
  animation: pulse-ring 2.4s ease-in-out infinite;
}

.identity.locked {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(22, 163, 74, 0.2);
  animation: none;
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.22);
}

.identity.locked .identity-ring { border-color: #4ade80; }
.identity.locked .identity-face { color: #4ade80; }

.identity-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.identity-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  transition: border-color 0.25s;
}

.identity.matched .identity-ring { border-color: #2dd4bf; }

.identity-face {
  font-size: 1.25rem;
  color: rgba(242, 246, 250, 0.45);
  line-height: 1;
}

.identity.matched .identity-face { color: #5eead4; }

.identity-copy { min-width: 0; flex: 1; }

.identity-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(242, 246, 250, 0.5);
}

.identity-name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0.12rem 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-meta {
  font-size: 0.84rem;
  color: rgba(242, 246, 250, 0.62);
  font-weight: 500;
  line-height: 1.3;
}

.done-banner {
  display: none;
  padding: 0.9rem 1rem;
  text-align: center;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.4);
}

.done-banner:not([hidden]) {
  display: block;
  animation: rise 0.35s ease both;
}

.done-banner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 750;
  margin-bottom: 0.2rem;
  color: #fef3c7;
}

.done-banner p {
  margin: 0 0 0.2rem;
  font-weight: 650;
  color: #fde68a;
  font-size: 0.9rem;
}

.done-banner span {
  font-size: 0.8rem;
  color: rgba(254, 243, 199, 0.7);
  font-weight: 500;
}

.challenge {
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s, background 0.25s;
}

.challenge.done {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(22, 163, 74, 0.18);
}

.challenge-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.challenge-step {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(242, 246, 250, 0.55);
  transition: background 0.25s, color 0.25s;
}

.challenge-step.on {
  background: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
}

.challenge-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: #fff;
  text-align: center;
}

.att-hint {
  margin: 0;
  color: rgba(242, 246, 250, 0.68);
  font-size: 0.88rem;
  line-height: 1.4;
  min-height: 1.3em;
}

.att-actions {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.att-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.att-actions .btn {
  padding: 0.95rem 0.7rem;
  border-radius: 16px;
  font-size: 0.92rem;
}

.att-actions .btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.att-actions .btn.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.att-actions .btn.primary {
  box-shadow: 0 12px 28px rgba(13, 159, 138, 0.35);
}

.att-side .toast {
  margin-top: 0.15rem;
}

.att-side .toast.ok {
  background: rgba(22, 163, 74, 0.22);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
}

.att-side .toast.err {
  background: rgba(220, 38, 38, 0.22);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

.att-foot {
  margin: 0.25rem 0 0;
  text-align: center;
  color: rgba(242, 246, 250, 0.55);
  font-size: 0.84rem;
}

.att-foot a {
  color: #7dd3c0;
  font-weight: 700;
  text-decoration: none;
}

.att-foot a:hover {
  text-decoration: underline;
}

/* Tablet / desktop — original side-by-side, no scroll */
@media (min-width: 860px) {
  .att-shell {
    padding: 1.25rem 1.5rem 1.75rem;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .att-hero {
    margin-bottom: 1.35rem;
  }

  .att-layout {
    grid-template-columns: minmax(320px, 1.05fr) minmax(300px, 0.95fr);
    gap: 1.35rem;
    align-items: center;
  }

  .att-stage {
    max-height: min(68vh, 620px);
    margin: 0;
  }

  .att-side {
    padding: 1.2rem;
    gap: 0.85rem;
  }

  .att-actions {
    margin-top: 0.15rem;
  }

  .att-actions-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  .att-layout {
    gap: 1.75rem;
  }
}

/* Mobile only — scroll allowed so Mark attendance always reachable */
@media (max-width: 859px) {
  html:has(.att-body) {
    height: auto;
    overflow: auto;
  }

  .att-body {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .att-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    padding-bottom: max(1.25rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
    overflow: visible;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .att-nav {
    margin-bottom: 0.4rem;
    flex-shrink: 0;
  }

  .att-nav-link {
    font-size: 0.76rem;
    padding: 0.3rem 0.55rem;
  }

  .att-hero {
    margin-bottom: 0.5rem;
    flex-shrink: 0;
  }

  .att-brand {
    font-size: 1.35rem;
  }

  .att-lead {
    display: none;
  }

  .att-layout {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow: visible;
  }

  .att-stage-wrap {
    flex: 0 0 auto;
    width: 100%;
    max-width: min(100%, 340px);
    margin: 0 auto;
    display: flex;
  }

  .att-stage {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    max-height: 42vh;
    min-height: 220px;
    margin: 0 auto;
    border-radius: 18px;
  }

  .att-side {
    flex: 0 0 auto;
    gap: 0.5rem;
    padding: 0.7rem 0.75rem;
    border-radius: 16px;
    margin-top: 0;
  }

  .identity {
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
  }

  .identity-avatar {
    width: 40px;
    height: 40px;
  }

  .identity-face {
    font-size: 1rem;
  }

  .identity-label {
    font-size: 0.6rem;
  }

  .identity-name {
    font-size: 1.05rem;
    margin: 0.04rem 0;
  }

  .identity-meta {
    font-size: 0.74rem;
  }

  .done-banner,
  .challenge {
    padding: 0.5rem 0.6rem;
  }

  .challenge-step {
    font-size: 0.62rem;
    padding: 0.3rem;
  }

  .challenge-text {
    font-size: 0.78rem;
  }

  .att-hint {
    font-size: 0.76rem;
    line-height: 1.35;
    min-height: 0;
  }

  .att-actions {
    position: static;
    margin: 0.15rem 0 0;
    padding: 0;
  }

  .att-actions-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .att-actions .btn.secondary {
    display: none;
  }

  .att-actions .btn {
    padding: 0.9rem 0.6rem;
    border-radius: 14px;
    font-size: 0.92rem;
    width: 100%;
  }

  .att-actions .btn.primary:disabled {
    opacity: 0.55;
  }

  .att-side .toast {
    margin-top: 0.15rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
  }

  .att-foot {
    display: none;
  }

  .att-stage .stage-status {
    bottom: 0.55rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
  }
}

@media (max-height: 700px) and (max-width: 859px) {
  .att-brand {
    font-size: 1.2rem;
  }

  .att-stage {
    max-height: 38vh;
    min-height: 180px;
  }

  .att-side {
    padding: 0.6rem 0.65rem;
  }
}

@media (max-height: 620px) and (max-width: 859px) {
  .att-brand {
    font-size: 1.1rem;
  }

  .att-stage {
    max-height: 34vh;
    min-height: 160px;
  }
}
