.totem-kiosk-close {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 2147483600;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(26, 38, 37, 0.08);
  color: #5c6e70;
  font: 20px/1 Inter, Montserrat, system-ui, sans-serif;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.totem-kiosk-close:active {
  background: rgba(26, 38, 37, 0.16);
}

.totem-kiosk-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  text-align: center;
  font-family: Inter, Montserrat, system-ui, sans-serif;
}

.totem-kiosk-overlay.is-open {
  display: flex;
}

.totem-kiosk-screensaver {
  z-index: 2147483900;
  display: flex;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  background: #050908;
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 420ms ease, visibility 420ms ease;
  isolation: isolate;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.totem-kiosk-screensaver::before,
.totem-kiosk-screensaver::after {
  content: "";
  position: absolute;
  inset: 0;
}

.totem-kiosk-screensaver::before {
  z-index: -2;
  background-image: var(--totem-screensaver-image, url("./screensaver-clinica-san-javier.png"));
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.015);
  animation: totem-screensaver-drift 18s ease-in-out infinite alternate;
}

.totem-kiosk-screensaver::after {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 93, 108, 0.06), transparent 46%),
    linear-gradient(180deg, rgba(1, 10, 12, 0.18) 0%, rgba(0, 0, 0, 0.08) 58%, rgba(0, 0, 0, 0.48) 100%);
}

.totem-kiosk-screensaver.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.totem-kiosk-screensaver:focus-visible {
  outline: 4px solid rgba(169, 201, 45, 0.92);
  outline-offset: -8px;
}

.totem-kiosk-screensaver__content {
  width: min(100%, 680px);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.totem-kiosk-screensaver__glass {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: clamp(20px, 4vw, 42px);
  padding: clamp(17px, 2vh, 23px) clamp(26px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: clamp(28px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 48%, rgba(255, 255, 255, 0.08)),
    rgba(5, 24, 27, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 34px 90px rgba(0, 0, 0, 0.38),
    0 8px 28px rgba(0, 96, 112, 0.18);
  -webkit-backdrop-filter: blur(5px) saturate(112%);
  backdrop-filter: blur(5px) saturate(112%);
  overflow: hidden;
  text-align: left;
}

.totem-kiosk-screensaver__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 30%, transparent 68%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

.totem-kiosk-screensaver__eyebrow {
  position: relative;
  display: none;
  grid-column: 1;
  margin-bottom: 9px;
  color: #d5ef75;
  font-size: clamp(15px, 2.1vw, 22px);
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.totem-kiosk-screensaver h1 {
  position: relative;
  margin: 0;
  color: #ffffff;
  grid-column: 1;
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.32);
}

.totem-kiosk-screensaver p {
  position: relative;
  grid-column: 1;
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 500;
  line-height: 1.35;
}

.totem-kiosk-screensaver__gesture {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  width: clamp(60px, 8vw, 76px);
  height: clamp(60px, 8vw, 76px);
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 12px 32px rgba(0, 0, 0, 0.2);
  animation: totem-screensaver-pulse 2.4s ease-in-out infinite;
}

.totem-kiosk-screensaver__gesture svg {
  width: 52%;
  height: 52%;
  overflow: visible;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.totem-kiosk-screensaver__tap {
  stroke: #d5ef75;
  opacity: 0.95;
}

@keyframes totem-screensaver-drift {
  from { transform: scale(1.015) translate3d(0, 0, 0); }
  to { transform: scale(1.055) translate3d(0, -0.6%, 0); }
}

@keyframes totem-screensaver-pulse {
  0%, 100% { transform: scale(1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(213, 239, 117, 0.24); }
  50% { transform: scale(1.045); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 18px rgba(213, 239, 117, 0); }
}

@media (orientation: landscape) {
  .totem-kiosk-screensaver__content {
    width: min(88vw, 1120px);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
  }

  .totem-kiosk-screensaver__glass { width: min(72vw, 760px); }
}

.totem-kiosk-hold {
  flex-direction: column;
  background: rgba(10, 68, 68, 0.92);
}

.totem-kiosk-hold__count {
  color: #ffffff;
  font-size: 88px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.totem-kiosk-hold p {
  max-width: 320px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.4;
}

.totem-kiosk-closed {
  z-index: 2147483800;
  flex-direction: column;
  gap: 14px;
  background: #0a0f0f;
  overflow-y: auto;
}

.totem-admin-panel {
  width: min(100%, 560px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: #132122;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  color: #ffffff;
  text-align: left;
}

.totem-admin-panel__eyebrow {
  margin: 0;
  color: #a9c92d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.totem-admin-panel h2 {
  margin: 6px 0 8px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
}

.totem-admin-panel__intro {
  margin: 0 0 20px;
  color: #bdccca;
  font-size: 14px;
  line-height: 1.45;
}

.totem-admin-form {
  display: grid;
  gap: 11px;
}

.totem-admin-form label {
  color: #dce8e7;
  font-size: 13px;
  font-weight: 800;
}

.totem-admin-form input {
  width: 100%;
  border: 1px solid #506364;
  border-radius: 10px;
  padding: 12px 13px;
  background: #ffffff;
  color: #17282c;
  font: 600 15px/1.35 Inter, Montserrat, system-ui, sans-serif;
  user-select: text;
  -webkit-user-select: text;
}

.totem-admin-form input:focus {
  outline: 3px solid rgba(169, 201, 45, 0.34);
  border-color: #a9c92d;
}

.totem-admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.totem-admin-button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 11px 14px;
  background: #244143;
  color: #ffffff;
  font: 800 14px/1.25 Inter, Montserrat, system-ui, sans-serif;
  cursor: pointer;
}

.totem-admin-button--primary {
  border-color: #a9c92d;
  background: #687f13;
}

.totem-admin-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.totem-admin-status {
  min-height: 20px;
  margin: 0;
  color: #bdd0ce;
  font-size: 13px;
  line-height: 1.4;
}

.totem-admin-status.is-error {
  color: #ffb8b8;
}

.totem-admin-status.is-success {
  color: #cfe890;
}

.totem-kiosk-reopen {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.07);
  color: #8fb0ae;
  font: 700 12.5px/1.2 Inter, Montserrat, system-ui, sans-serif;
  cursor: pointer;
}

@media (max-width: 560px) {
  .totem-admin-panel { padding: 22px; }
  .totem-admin-actions { grid-template-columns: 1fr; }
}

.totem-kiosk-idle {
  background: rgba(26, 38, 37, 0.72);
}

.totem-kiosk-idle__box {
  width: min(100%, 340px);
  padding: 26px;
  border-radius: 16px;
  background: #ffffff;
}

.totem-kiosk-idle__count {
  color: #5e6b26;
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.totem-kiosk-idle h2 {
  margin: 12px 0 6px;
  color: #17282c;
  font-size: 19px;
}

.totem-kiosk-idle p {
  margin: 0;
  color: #5c6e70;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .totem-kiosk-overlay,
  .totem-kiosk-close {
    transition: none !important;
  }

  .totem-kiosk-screensaver::before,
  .totem-kiosk-screensaver__gesture {
    animation: none !important;
  }
}
