:root {
  font-family: var(--coelnicsa-font-sans);
  color: var(--coelnicsa-color-primary, #221d59);
  background: #f6f5f8;
}

html {
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-width: 320px;
  margin: 0;
  background: #f6f5f8;
}

.kiosco {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  flex: 1;
  min-height: 0;
  padding: clamp(0.85rem, 2.5vh, 1.5rem) clamp(1rem, 4vw, 2.5rem);
  overflow: hidden;
  background: #f6f5f8;
  transition: background 700ms ease, color 700ms ease;
}

.kiosco>header,
.kiosco>.marcacion,
.kiosco>.acceso-admin {
  position: relative;
  z-index: 1;
}

.kiosco--dia {
  background: #faf8ed;
}

.kiosco--noche {
  background: #17123d;
}

.kiosco--tarde {
  background: #faeadb;
}

.escena-turno {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sol-grande,
.luna-grande,
.sol-atardecer {
  position: absolute;
  top: clamp(6rem, 12vw, 9rem);
  right: clamp(-2.8rem, 9vw, 7rem);
  width: clamp(11rem, 22vw, 17rem);
  height: clamp(11rem, 22vw, 17rem);
  border-radius: 50%;
}

.sol-grande {
  background: #fdec4d;
  box-shadow: 0 0 0 1.4rem rgba(253, 236, 77, 0.18), 0 0 0 3rem rgba(253, 236, 77, 0.08);
}

.sol-atardecer {
  top: clamp(12rem, 27vw, 16rem);
  background: #ffb14e;
  box-shadow: 0 0 0 1.2rem rgba(255, 177, 78, 0.18), 0 0 0 2.7rem rgba(255, 177, 78, 0.08);
}

.nubes-atardecer i {
  position: absolute;
  width: 7rem;
  height: 1.1rem;
  background: #d46f5d;
  border-radius: 999px;
  opacity: 0.6;
}

.nubes-atardecer i::before,
.nubes-atardecer i::after {
  position: absolute;
  bottom: 0;
  width: 2.3rem;
  height: 2.3rem;
  content: '';
  background: inherit;
  border-radius: 50%;
}

.nubes-atardecer i::before {
  left: 1rem;
}

.nubes-atardecer i::after {
  right: 1rem;
}

.nubes-atardecer i:nth-child(1) {
  top: 22%;
  left: 8%;
}

.nubes-atardecer i:nth-child(2) {
  top: 46%;
  right: 9%;
  transform: scale(0.72);
}

.sol-grande i {
  position: absolute;
  top: 50%;
  left: -2.7rem;
  width: calc(100% + 5.4rem);
  height: 0.34rem;
  background: #fdec4d;
  border-radius: 999px;
  opacity: 0.75;
}

.sol-grande i:nth-child(1) {
  transform: rotate(0deg);
}

.sol-grande i:nth-child(2) {
  transform: rotate(45deg);
}

.sol-grande i:nth-child(3) {
  transform: rotate(90deg);
}

.sol-grande i:nth-child(4) {
  transform: rotate(135deg);
}

.luna-grande {
  background: #fdec4d;
  box-shadow: 0 0 38px rgba(253, 236, 77, 0.28);
}

.luna-grande::after {
  position: absolute;
  top: -0.9rem;
  right: -1.7rem;
  width: 100%;
  height: 100%;
  content: '';
  background: #17123d;
  border-radius: 50%;
}

.estrellas i {
  position: absolute;
  width: 0.35rem;
  height: 0.35rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 9px #fff;
  animation: brillar 2.2s ease-in-out infinite alternate;
}

.estrellas i:nth-child(1) {
  top: 12%;
  left: 10%;
}

.estrellas i:nth-child(2) {
  top: 25%;
  left: 27%;
  animation-delay: 0.4s;
}

.estrellas i:nth-child(3) {
  top: 9%;
  left: 55%;
  animation-delay: 0.8s;
}

.estrellas i:nth-child(4) {
  top: 39%;
  left: 74%;
  animation-delay: 1.2s;
}

.estrellas i:nth-child(5) {
  top: 63%;
  left: 14%;
  animation-delay: 0.3s;
}

.estrellas i:nth-child(6) {
  top: 72%;
  left: 42%;
  animation-delay: 1.1s;
}

.estrellas i:nth-child(7) {
  top: 56%;
  left: 88%;
  animation-delay: 0.6s;
}

.estrellas i:nth-child(8) {
  top: 18%;
  left: 89%;
  animation-delay: 1.5s;
}

@keyframes brillar {
  from {
    transform: scale(0.65);
    opacity: 0.35;
  }

  to {
    transform: scale(1.35);
    opacity: 1;
  }
}

/* Marca y reloj */
.encabezado-kiosco {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 440px);
  margin: 0 auto;
}

.encabezado-kiosco img {
  width: 155px;
  transition: filter 500ms ease;
}

.kiosco--noche .encabezado-kiosco img {
  filter: brightness(0) invert(1);
}

.reloj {
  display: flex;
  flex: 0 0 205px;
  gap: 9px;
  align-items: center;
  justify-content: flex-start;
  width: 205px;
  padding: 6px 10px 6px 6px;
  background: #fff;
  border: 1px solid #e4e1ed;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(35, 29, 90, 0.08);
  transition: color 500ms ease, background 500ms ease, border-color 500ms ease;
}

.kiosco--noche .reloj {
  background: #282153;
  border-color: #514a81;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.kiosco--noche .reloj-info span {
  color: #cbc7e8;
}

.kiosco--noche .reloj-info strong {
  color: #fff;
}

.kiosco--tarde .marcacion {
  border-top-color: #ffb14e;
}

.reloj-analogico {
  position: relative;
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  background: #fbfaff;
  border: 4px solid #231d5a;
  border-radius: 50%;
}

.reloj-analogico b {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 0.52rem;
  height: 0.52rem;
  transform: translate(-50%, -50%);
  background: #fdec4d;
  border: 2px solid #231d5a;
  border-radius: 50%;
}

.manecilla {
  position: absolute;
  z-index: 2;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: bottom;
  background: #231d5a;
  border-radius: 99px;
}

.manecilla--hora {
  width: 4px;
  height: 1.05rem;
}

.manecilla--minuto {
  width: 3px;
  height: 1.45rem;
}

.manecilla--segundo {
  width: 1px;
  height: 1.6rem;
  background: #d1aa00;
}

.marca-hora {
  position: absolute;
  width: 3px;
  height: 0.55rem;
  background: #231d5a;
  border-radius: 8px;
}

.marca-hora--doce {
  top: 0.32rem;
  left: calc(50% - 1.5px);
}

.marca-hora--tres {
  top: calc(50% - 1.5px);
  right: 0.32rem;
  transform: rotate(90deg);
}

.marca-hora--seis {
  bottom: 0.32rem;
  left: calc(50% - 1.5px);
}

.marca-hora--nueve {
  top: calc(50% - 1.5px);
  left: 0.32rem;
  transform: rotate(90deg);
}

.reloj-info {
  display: grid;
  gap: 1px;
}

.reloj-info span {
  color: #7d789b;
  font-size: 0.68rem;
  font-weight: 700;
}

.reloj-info strong {
  color: #231d5a;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Saludo segun el turno */
.saludo-turno {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  padding: 0.42rem 0.62rem;
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 999px;
}

.saludo-turno svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.saludo-turno--dia {
  color: #765b00;
  background: #fff4bb;
}

.saludo-turno--noche {
  color: #514a70;
  background: #efedf8;
}

/* Tarjeta de marcacion */
.marcacion {
  position: relative;
  align-self: center;
  width: min(100%, 440px);
  margin: clamp(0.75rem, 2vh, 1.25rem) auto;
  padding: clamp(1.25rem, 3vw, 1.6rem);
  background: #fff;
  border: 1px solid #e8e5f0;
  border-top: 5px solid var(--coelnicsa-color-accent, #fded4c);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(34, 29, 89, 0.1);
}

.marcacion h1 {
  margin: 0.35rem 0 0.45rem;
  color: var(--coelnicsa-color-primary, #221d59);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 800;
  line-height: 1.08;
  white-space: nowrap;
}

.ayuda {
  max-width: 330px;
  margin: 0 0 1.1rem;
  color: #687085;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

.metodo-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 0.85rem;
  background: #f1f3f7;
  border: 1px solid #e2e6ee;
  border-radius: 12px;
}

.metodo-opcion {
  min-height: 38px;
  padding: 0.45rem 0.35rem;
  color: #667085;
  font: inherit;
  font-size: 0.77rem;
  font-weight: 750;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.metodo-opcion.is-active {
  color: #fff;
  background: var(--coelnicsa-color-primary, #221d59);
  box-shadow: 0 4px 10px rgba(34, 29, 89, 0.18);
}

.metodo-opcion:focus-visible {
  outline: 3px solid var(--coelnicsa-color-accent, #fded4c);
  outline-offset: 1px;
}

.panel-metodo {
  min-width: 0;
}

#codigoBarra {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.ayuda-escaneo {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0 0;
  color: #667085;
  font-size: 0.72rem;
  font-weight: 650;
}

.ayuda-escaneo span {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 0.55rem;
  background: #18a66a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(24, 166, 106, 0.12);
}

.panel-metodo.is-processing .ayuda-escaneo span {
  background: var(--coelnicsa-color-accent, #fded4c);
  box-shadow: 0 0 0 4px rgba(253, 237, 76, 0.28);
}

.panel-camara {
  display: grid;
  gap: 0.65rem;
}

.panel-camara[hidden] {
  display: none;
}

.camara-acciones {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.boton-camara,
.captura-alternativa {
  min-height: 2.65rem;
  padding: 0.65rem 0.85rem;
  color: var(--coelnicsa-color-primary, #221d59);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  background: #f4f2fb;
  border: 1px solid #dcd8ee;
  border-radius: 11px;
}

.boton-camara--principal {
  color: #fff;
  background: var(--coelnicsa-color-primary, #221d59);
  border-color: var(--coelnicsa-color-primary, #221d59);
}

.boton-camara:disabled {
  cursor: wait;
  opacity: 0.65;
}

.selector-camara {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  margin: 0;
}

.selector-camara select {
  min-width: 0;
  min-height: 2.45rem;
  padding: 0 0.7rem;
  color: #292348;
  font: inherit;
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid #d9d6e2;
  border-radius: 10px;
}

.lector-camara {
  overflow: hidden;
  background: #151229;
  border-radius: 13px;
}

.lector-camara:empty {
  display: none;
}

.lector-camara video,
.lector-camara img {
  display: block;
  width: 100% !important;
  max-height: 230px;
  object-fit: cover;
}

.estado-camara {
  margin: 0;
  color: #667085;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.4;
}

.estado-camara--error {
  color: #b42318;
}

.captura-alternativa {
  display: grid;
  place-items: center;
  min-height: 2.45rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
}

.entrada-foto {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.captura-alternativa:focus-within,
.boton-camara:focus-visible,
.selector-camara select:focus-visible {
  outline: 3px solid var(--coelnicsa-color-accent, #fded4c);
  outline-offset: 2px;
}

form {
  display: grid;
  gap: 0.42rem;
}

label {
  margin-top: 0.3rem;
  color: #514a70;
  font-size: 0.8rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  color: var(--coelnicsa-color-primary, #221d59);
  font: inherit;
  font-weight: 700;
  background: #fbfaff;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  outline: 0;
}

input:focus {
  background: #fff;
  border-color: var(--coelnicsa-color-primary, #221d59);
  box-shadow: 0 0 0 3px rgba(34, 29, 89, 0.14);
}

.pin {
  position: relative;
}

.pin input {
  padding-right: 4.6rem;
}

.mostrar-pin {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  padding: 0.3rem;
  color: #231d5a;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  border: 0;
  transform: translateY(-50%);
}

.marcacion form>button {
  min-height: 3rem;
  margin-top: 0.75rem;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--coelnicsa-color-primary, #221d59);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(34, 29, 89, 0.2);
}

.marcacion form>button:hover {
  background: #342c78;
}

.marcacion form>button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.resultado {
  padding: 0.9rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 0.7rem;
}

.resultado strong {
  margin-right: 0.35rem;
}

.resultado--exito {
  color: #13704d;
  background: #eaf8f1;
}

.resultado--error {
  color: #a1263a;
  background: #fff0f1;
}

.tip {
  padding-top: 0.75rem;
  margin: 0.9rem 0 0;
  color: #7c8395;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.55;
  border-top: 1px solid #ece9f3;
}

.acceso-admin {
  display: block;
  width: fit-content;
  margin: 0 auto;
  color: #514a70;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.kiosco--noche .acceso-admin {
  color: #fff;
}

.acceso-admin:hover {
  color: #231d5a;
}

footer {
  position: relative;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  min-height: 3rem;
  padding: 0.85rem 0.8rem 0.55rem;
  color: #514a70;
  font-size: 0.65rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  background: #fff;
  border-top: 1px solid #eae7f0;
  transition: color 500ms ease, background 500ms ease, border-color 500ms ease;
}

footer::before {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  width: 3rem;
  height: 0.18rem;
  content: '';
  background: #fdec4d;
  border-radius: 999px;
  transform: translateX(-50%);
}

.pie-marca {
  color: #231d5a;
  font-weight: 800;
}

.pie-descripcion {
  color: #7d789b;
  font-weight: 700;
}

.pie-separador {
  color: #d0cae4;
}

.pie-anio {
  color: #7d789b;
  font-size: 0.65rem;
  font-weight: 800;
}

footer.pie--noche {
  color: #fff;
  background: #17123d;
  border-color: #2c2655;
}

footer.pie--noche::before {
  background: #fdec4d;
}

footer.pie--noche .pie-marca,
footer.pie--noche .pie-descripcion {
  color: #fff;
}

footer.pie--noche .pie-separador {
  color: #968fbd;
}

footer.pie--noche .pie-anio {
  color: #cbc7e8;
}

footer.pie--tarde {
  color: #7a3f34;
  background: #f7d0a7;
  border-color: #e9b984;
}

footer.pie--tarde::before {
  background: #d46f5d;
}

footer.pie--tarde .pie-marca {
  color: #7a3f34;
}

footer.pie--tarde .pie-descripcion {
  color: #925749;
}

footer.pie--tarde .pie-anio {
  color: #925749;
}

@media (max-width: 460px) {
  .kiosco {
    padding: 1rem;
  }

  .encabezado-kiosco img {
    width: 115px;
  }

  .reloj {
    flex: 0 0 auto;
    gap: 6px;
    width: auto;
    min-width: 122px;
    padding: 5px 7px 5px 5px;
    margin-left: auto;
    border-radius: 11px;
  }

  .reloj-analogico {
    width: 2.65rem;
    height: 2.65rem;
    border-width: 2px;
  }

  .manecilla--hora {
    height: 0.62rem;
  }

  .manecilla--minuto,
  .manecilla--segundo {
    height: 0.88rem;
  }

  .marca-hora {
    width: 2px;
    height: 0.34rem;
  }

  .marca-hora--doce,
  .marca-hora--seis {
    left: calc(50% - 1px);
  }

  .marca-hora--tres {
    top: calc(50% - 1px);
    right: 0.2rem;
  }

  .marca-hora--nueve {
    top: calc(50% - 1px);
    left: 0.2rem;
  }

  .marca-hora--doce {
    top: 0.2rem;
  }

  .marca-hora--seis {
    bottom: 0.2rem;
  }

  .reloj-analogico b {
    width: 0.38rem;
    height: 0.38rem;
    border-width: 1px;
  }

  .reloj-info span {
    font-size: 0.6rem;
  }

  .reloj-info strong {
    font-size: 0.72rem;
  }

  .marcacion {
    margin: 0.9rem auto;
    border-radius: 18px;
  }

  .sol-grande,
  .luna-grande,
  .sol-atardecer {
    top: 5.5rem;
    right: -4.8rem;
    width: 9rem;
    height: 9rem;
  }

  .saludo-turno {
    font-size: 0.61rem;
  }

  footer {
    gap: 0.28rem;
    flex-wrap: nowrap;
    min-height: 3.4rem;
    padding: 1rem 0.7rem 0.65rem;
    font-size: 0.52rem;
  }

  .pie-descripcion {
    flex-basis: auto;
  }

  .pie-separador {
    display: inline;
  }

  .pie-anio {
    font-size: 0.52rem;
  }
}

@media (max-width: 560px) {
  .kiosco {
    min-height: 0;
    padding: 1rem;
  }

  .encabezado-kiosco {
    gap: 0.55rem;
  }

  .marcacion {
    width: 100%;
    margin: 0.85rem auto;
    padding: 1.25rem;
  }

  .saludo-turno {
    margin: 0 0 0.75rem;
  }

  .marcacion h1 {
    font-size: clamp(1.4rem, 6vw, 1.7rem);
  }

  .ayuda {
    margin-bottom: 1.35rem;
    font-size: 0.86rem;
  }

  input,
  .marcacion form>button {
    min-height: 3rem;
  }
}

@media (max-width: 360px) {
  .encabezado-kiosco {
    flex-direction: row;
    align-items: center;
  }

  .encabezado-kiosco img {
    width: 105px;
  }

  .reloj {
    flex: 0 0 auto;
    width: auto;
    min-width: 118px;
  }

  .marcacion {
    padding: 1.15rem;
  }
}
