:root{
  --bg:#05060a;
  --panel:#0b0d12;
  --led:#ff7a00;
  --muted:#9aa0a6;
  --glass: rgba(255,255,255,0.03);
  --radius:14px;
  --accent:#ff7a00;
}

*{box-sizing:border-box}
html,body,#app{height:100%}
body{
  margin:0;
  background:
    linear-gradient(180deg, rgba(4,5,9,0.6), rgba(7,16,26,0.6)),
    url('https://aioi.mx/coodifondo.jpg') center/cover fixed no-repeat;
  color:#e6eef6;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
}

#app{
  width:100%;
  max-width:1200px;
  min-height:calc(100vh - 28px);
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* Brand header */
.brand-led{
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:12px;
  padding:10px 14px;
  box-shadow: 0 0 18px rgba(0,0,0,0.6), inset 0 0 18px rgba(0,0,0,0.5);
  position:relative;
  z-index:50;
  overflow:visible;
}
.brand-row{display:flex;align-items:center;gap:12px}
.site-logo{height:40px;width:auto;object-fit:contain;filter:drop-shadow(0 6px 18px rgba(0,0,0,0.6))}
.brand-inner{
  text-align:left;
  font-weight:700;
  letter-spacing:1px;
  color:var(--led);
  text-shadow:0 0 14px rgba(255,122,0,0.8);
  font-size:18px;
}

/* LED footer */
.footer-led{
  margin-top:auto;
  border-radius:10px;
  padding:10px;
  text-align:center;
  color:var(--led);
  font-weight:600;
  box-shadow:0 6px 30px rgba(255,122,0,0.06), 0 0 40px rgba(255,122,0,0.08);
  background: linear-gradient(90deg, rgba(255,122,0,0.05), transparent);
  animation: glow 2s infinite ease-in-out;
}
@keyframes glow{
  0%{filter:drop-shadow(0 0 6px rgba(255,122,0,0.4))}
  50%{filter:drop-shadow(0 0 18px rgba(255,122,0,0.75))}
  100%{filter:drop-shadow(0 0 6px rgba(255,122,0,0.4))}
}

/* grid layout */
.grid{
  display:grid;
  gap:12px;
  grid-template-columns:1fr;
  grid-auto-rows:min-content;
  margin-top:64px; /* lowered the containers to give header/logo more breathing room */
}
@media(min-width:900px){
  .grid{
    grid-template-columns: 1fr 1fr;
  }
  #panel-bgcolor{grid-column:1}
  #panel-data{grid-column:2}
  #panel-qrcolor{grid-column:1}
  #panel-controls{grid-column:2}
}

/* panels */
.panel{
  /* glass effect: translucent, subtle blur */
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  background-color: rgba(255,255,255,0.02);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius:var(--radius);
  padding:12px;
  min-height:140px;
  box-shadow: 0 6px 26px rgba(0,0,0,0.6);
  position:relative;
  z-index:1;
  overflow:hidden;
}
.panel h2{
  margin:0 0 10px 0;
  font-size:13px;
  color:var(--muted);
  letter-spacing:0.6px;
  font-weight:700;
}

/* led frame */
.led-frame{
  padding:14px;
  border-radius:18px;
  box-shadow: 0 6px 40px rgba(0,0,0,0.7);
  border:1px solid rgba(255,255,255,0.02);
  position:relative;
}
.led-frame::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  padding:2px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events:none;
}
.led-frame::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:calc(var(--radius) + 2px);
  background:linear-gradient(90deg, rgba(255,122,0,0.15), rgba(255,122,0,0.02));
  z-index:0;
  filter: blur(8px);
  mix-blend-mode:screen;
  opacity:0.95;
  animation: ledPulse 2.2s infinite ease-in-out;
  pointer-events:none;
}
@keyframes ledPulse{
  0%{transform:translateY(0) scale(1); opacity:0.7}
  50%{transform:translateY(-2px) scale(1.02); opacity:1}
  100%{transform:translateY(0) scale(1); opacity:0.7}
}

/* swatches */
.swatches{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.swatch{
  width:36px;
  height:36px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 12px rgba(0,0,0,0.6), inset 0 -2px 6px rgba(0,0,0,0.25);
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
  flex:0 0 auto;
}
.swatch:active{transform:scale(.92)}
.swatch.selected{outline:3px solid rgba(255,255,255,0.08); transform:scale(1.08)}

/* form */
form{display:flex;flex-direction:column;gap:8px}
label{display:flex;flex-direction:column;font-size:12px;color:var(--muted)}
input[type="text"],input[type="email"],input[type="url"]{
  margin-top:6px;
  padding:10px 12px;
  border-radius:10px;
  border:none;
  background:rgba(255,255,255,0.02);
  color:inherit;
  outline: none;
  box-shadow: inset 0 -2px 8px rgba(0,0,0,0.6);
}
.form-actions{display:flex;gap:8px;margin-top:6px}
.btn{
  padding:10px 12px;border-radius:10px;border:none;background:rgba(255,255,255,0.03);color:inherit;cursor:pointer;
  box-shadow:0 6px 20px rgba(0,0,0,0.6);
}
.btn.primary{background:var(--accent);color:#111;font-weight:700}
.btn.led-orange{
  background:var(--led);
  color:#111;
  font-weight:700;
  box-shadow: 0 8px 30px rgba(255,122,0,0.25);
  position:relative;
  overflow:visible;
  transition:transform .12s ease, box-shadow .12s ease;
  animation: ledButtonPulse 2.2s infinite ease-in-out;
}
@keyframes ledButtonPulse{
  0%{box-shadow:0 8px 28px rgba(255,122,0,0.20), 0 0 8px rgba(255,122,0,0.08);}
  50%{box-shadow:0 14px 40px rgba(255,122,0,0.32), 0 0 22px rgba(255,160,60,0.18); transform:translateY(-2px);}
  100%{box-shadow:0 8px 28px rgba(255,122,0,0.20), 0 0 8px rgba(255,122,0,0.08); transform:translateY(0);}
}

/* crystal / glass button style for unlock */
.btn.crystal{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  color:var(--led);
  font-weight:800;
  box-shadow: inset 0 -8px 18px rgba(0,0,0,0.45), 0 8px 22px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px) saturate(120%);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn.crystal:active{ transform: translateY(1px) scale(.998); box-shadow: inset 0 -6px 14px rgba(0,0,0,0.45); }

/* menu */
.menu{display:flex;flex-direction:column;gap:10px}
.infinite-palette{display:flex;gap:8px;align-items:center;margin-top:10px}
.infinite-palette input[type="color"]{width:44px;height:38px;border-radius:8px;border:none;padding:0}
.menu-row{display:flex;gap:10px;flex-wrap:wrap}

/* Emotion / confetti styles */
.confetti{
  width:10px;height:14px;border-radius:2px;position:absolute;left:0;top:0;pointer-events:none;
  box-shadow: 0 6px 12px rgba(0,0,0,0.45);
}
/* small visual hint for saved preset */
#btn-save-preset{transition:transform .12s ease}
#btn-save-preset:active{transform:scale(.96)}
.menu-item{display:flex;flex-direction:column;gap:6px;flex:1;min-width:160px}
.menu-item input[type=file]{display:block}
.menu-item select, .menu-item input[type=range]{background:transparent;color:inherit}

/* preview */
.preview-wrap{display:flex;justify-content:center;align-items:flex-start;gap:12px;margin-top:10px;flex-wrap:wrap}

/* live data panel (real-time form values) */
.live-panel{
  min-width:220px;
  max-width:320px;
  padding:12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:12px;
  box-shadow: 0 6px 26px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.03);
}
.live-panel ul{margin:0;padding-left:16px}
.live-panel li{margin:6px 0;color:rgba(230,238,246,0.92);font-size:14px;line-height:1.3}
.live-panel li .label{color:var(--muted);font-weight:700;margin-right:6px}

/* footer logos */
.footer-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.footer-logos img{height:30px;margin-left:8px;object-fit:contain;filter:drop-shadow(0 6px 18px rgba(0,0,0,0.45))}
.footer-copy{flex:1}
.preview{
  width:100%;
  max-width:520px;
  height:auto;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.02));
  border-radius:12px;
  padding:18px;
  display:flex;
  justify-content:center;
  align-items:center;
  box-shadow: inset 0 6px 18px rgba(0,0,0,0.6);
}

/* animated LED glow for QR corner shapes: uses CSS var --corner-color set from JS */
#qr-preview.corner-glow svg {
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6)) drop-shadow(0 0 6px rgba(0,0,0,0.35));
  /* improve vector rendering quality for dot styles to reduce pixelized artifacts */
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  image-rendering: optimizeQuality;
  vector-effect: non-scaling-stroke;
}
#qr-preview.corner-glow {
  position:relative;
  transition:box-shadow .2s ease, transform .18s ease;
  animation: cornerPulse 2s infinite ease-in-out;
  box-shadow: 0 0 18px rgba(0,0,0,0.35);
}
/* premium animated LED frame around preview: gradient cycles and subtle movement */
#qr-preview.qr-led-frame::before{
  content:"";
  position:absolute;
  inset:-8px;
  border-radius:18px;
  background:linear-gradient(90deg, rgba(255,122,0,0.18), rgba(0,200,255,0.12), rgba(180,80,255,0.12), rgba(255,122,0,0.12));
  z-index: -1;
  filter: blur(14px);
  animation: ledCycle 4s linear infinite;
  mix-blend-mode:screen;
  pointer-events:none;
}
@keyframes ledCycle{
  0%{transform:translateY(0) rotate(0deg); opacity:0.9}
  50%{transform:translateY(-2px) rotate(4deg); opacity:1}
  100%{transform:translateY(0) rotate(0deg); opacity:0.9}
}
@keyframes cornerPulse {
  0% { box-shadow: 0 0 6px rgba(0,0,0,0.2), 0 0 0px var(--corner-color, rgba(255,122,0,0.25)); }
  50% { box-shadow: 0 0 18px rgba(0,0,0,0.35), 0 0 22px var(--corner-color, rgba(255,122,0,0.35)); transform: translateY(-1px); }
  100% { box-shadow: 0 0 6px rgba(0,0,0,0.2), 0 0 0px var(--corner-color, rgba(255,122,0,0.25)); transform: translateY(0); }
}
/* small glow on the actual qr svg paths to approximate LED lighting */
#qr-preview.corner-glow svg path, #qr-preview.corner-glow svg rect {
  transition:filter .18s ease, opacity .18s ease;
  filter: drop-shadow(0 0 0px transparent);
}
#qr-preview.corner-glow svg [fill] {
  /* add a subtle outer glow by layering a blurred duplicate via filter using the CSS variable */
  mix-blend-mode:screen;
}

/* responsive tweaks */
@media(max-width:720px){
  .swatch{width:34px;height:34px}
  .preview{max-width:360px;padding:12px}
}

/* LOGIN OVERLAY STYLES */
#login-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(2,4,8,0.85), rgba(2,4,8,0.92));
  z-index:99999;
  backdrop-filter: blur(6px);
  padding:18px;
}

/* translucent top banner inside overlay */
.login-top-banner{
  position:fixed;
  top:18px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  border-radius:12px;
  padding:10px 14px;
  border:1px solid rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
  box-shadow:0 8px 30px rgba(0,0,0,0.6);
  z-index:100000;
  max-width:min(880px,92vw);
}
.top-aioi-logo{height:28px;object-fit:contain;filter:drop-shadow(0 8px 16px rgba(0,0,0,0.45))}
.top-banner-text{font-size:13px;color:var(--muted);font-weight:700;letter-spacing:0.6px}
.top-banner-text .top-link{color:var(--led);text-shadow:0 0 8px rgba(255,122,0,0.45);font-weight:800}

/* wrapper to stack title and card */
.login-wrapper{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  width:100%;
  max-width:520px;
}

/* big animated LED title above card */
.login-title{
  font-size:14px;
  text-align:center;
  font-weight:800;
  color:var(--led);
  text-shadow:
    0 0 6px rgba(255,122,0,0.9),
    0 0 18px rgba(255,122,0,0.6);
  padding:6px 10px;
  border-radius:10px;
  background:linear-gradient(90deg, rgba(255,122,0,0.03), rgba(255,122,0,0.02));
  animation: titleGlow 2.2s infinite ease-in-out;
  line-height:1.2;
  letter-spacing:0.6px;
}
@keyframes titleGlow{
  0%{text-shadow:0 0 6px rgba(255,122,0,0.7)}
  50%{text-shadow:0 0 20px rgba(255,200,80,1)}
  100%{text-shadow:0 0 6px rgba(255,122,0,0.7)}
}

.login-card{
  width:min(480px,92vw);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border:1px solid rgba(255,255,255,0.04);
  padding:20px;
  border-radius:16px;
  text-align:center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.7);
  position:relative;
  z-index:100001;
}
.login-logo{
  height:120px;
  margin-bottom:8px;
  width:auto;
  max-width:86%;
  object-fit:contain;
  filter:drop-shadow(0 18px 40px rgba(0,0,0,0.6));
}
.login-card h2{margin:6px 0 4px 0;color:var(--led);font-size:18px}
.login-note{margin:4px 0 12px 0;color:var(--muted);font-size:13px}
#login-input{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:none;
  background:rgba(255,255,255,0.02);
  color:inherit;
  margin-top:10px;
  box-shadow: inset 0 -4px 12px rgba(0,0,0,0.6);
}
.login-actions{display:flex;gap:10px;justify-content:center;margin-top:12px;flex-wrap:wrap}
.login-card .btn{min-width:140px;padding:10px 14px}
.login-hint{margin-top:10px;font-size:12px;color:var(--muted)}

/* payment banner with LED frame below buttons */
.payment-banner{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01));
  border:1px solid rgba(255,255,255,0.03);
  box-shadow: 0 8px 30px rgba(255,122,0,0.035), 0 2px 8px rgba(0,0,0,0.6);
  position:relative;
  overflow:hidden;
}

/* login-card footer with logos and pulsing LED text */
.login-footer{
  margin-top:14px;
  padding:12px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.008));
  border:1px solid rgba(255,255,255,0.02);
  box-shadow: inset 0 6px 18px rgba(0,0,0,0.45);
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}
.footer-logos-row{display:flex;gap:12px;align-items:center;justify-content:center}
.footer-logo{height:28px;object-fit:contain;filter:drop-shadow(0 8px 18px rgba(0,0,0,0.45))}
.footer-logo.coodi{height:34px}
.footer-led-text{
  font-size:12px;
  color:var(--led);
  font-weight:700;
  text-align:center;
  letter-spacing:0.6px;
  text-shadow: 0 0 10px rgba(255,122,0,0.9);
  animation: footerLedPulse 3s infinite ease-in-out;
  max-width:92%;
}
@keyframes footerLedPulse{
  0%{text-shadow:0 0 8px rgba(255,122,0,0.6); transform:translateY(0)}
  50%{text-shadow:0 0 28px rgba(255,180,80,0.95); transform:translateY(-2px)}
  100%{text-shadow:0 0 8px rgba(255,122,0,0.6); transform:translateY(0)}
}
/* subtle LED rim */
.payment-banner::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:16px;
  background:linear-gradient(90deg, rgba(255,122,0,0.18), rgba(0,200,255,0.06));
  filter: blur(10px);
  pointer-events:none;
  mix-blend-mode:screen;
  opacity:0.95;
  animation: paymentPulse 3.6s linear infinite;
}
.payment-banner img{max-width:360px;width:100%;height:auto;display:block;object-fit:contain;z-index:2;position:relative}
@keyframes paymentPulse{
  0%{transform:translateY(0) rotate(0deg); opacity:0.9}
  50%{transform:translateY(-2px) rotate(2deg); opacity:1}
  100%{transform:translateY(0) rotate(0deg); opacity:0.9}
}

/* responsive tweaks */
@media(max-width:520px){
  .login-title{font-size:12px;padding:8px}
  .top-banner-text{display:none}
  .login-top-banner{padding:8px}
  .payment-banner img{max-width:260px}
}