:root{
  --bg:#040405;
  --panel:#0b0b0b;
  --muted:#9aa0a6;
  --accent:#1e90ff;
  --glass: rgba(255,255,255,0.03);
}

/* Fuentes locales */
@font-face {
  font-family: 'Noto Sans';
  src: url('fonts/NotoSans-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('fonts/NotoSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('fonts/NotoSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}


*{box-sizing:border-box}
html,body{
  height:100%;
  -webkit-touch-callout: none; /* disable iOS callout by default */
  -webkit-user-select: none;    /* disable selection */
  -ms-user-select: none;
  user-select: none;
  touch-action: pan-y; /* allow vertical scroll but prevent pinch/zoom gestures */
  overscroll-behavior: contain; /* prevent pull-to-refresh / navigation gestures */
}

/* Allow selection and default touch-callout inside inputs/textareas and links */
input, textarea, a {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Ensure interactive controls still respond to touch properly */
button, select, input, textarea {
  -webkit-user-select: auto;
  user-select: auto;
}

body{
  margin:0;
  font-family:"Noto Sans",system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;
  background:var(--bg);
  color:#e6e7e9;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:18px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

.app{
  width:100%;
  max-width:420px;
}

/* Header */
.top{
  text-align:center;
}
.top h1{
  font-size:16px;
  margin-bottom:4px;
  margin-left:0;
  margin-right:0;
}
.subtitle{margin:0;color:var(--muted);font-size:13px}

/* Controls */
.controls{
  margin-top:8px;
  padding:8px;
  border-radius:10px;
}
.field{display:block;margin-bottom:10px}
.field span{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.field textarea{
  width:100%;
  resize:vertical;
  min-height:36px;
  max-height:160px;
  background:var(--panel);
  border:1px solid rgba(255,255,255,0.12); /* subtle white border for form elements */
  color:#fff;
  padding:8px;
  border-radius:8px;
  font-size:13px;
}
.field input[type="file"]{
  width:100%;
  background:transparent;
  padding:6px 8px;
  color:#fff;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.12); /* match subtle border */
}
.field select,input[type="color"]{
  width:100%;
  appearance:none;
  padding:8px;
  border-radius:8px;
  background:var(--panel);
  border:1px solid rgba(255,255,255,0.12); /* subtle white outline */
  color:#fff;
  font-size:14px;
}

/* Make color inputs show the active color swatch clearly */
input[type="color"]{
  padding:6px;
  height:44px;
  background:transparent;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.12); /* ensure color swatch also shows outline */
  -webkit-appearance:none;
  appearance:none;
}

/* Chrome / Safari swatch tweaks */
input[type="color"]::-webkit-color-swatch-wrapper{
  padding:0;
  border-radius:8px;
}
input[type="color"]::-webkit-color-swatch{
  border-radius:6px;
  border:1px solid rgba(0,0,0,0.2);
}

/* Firefox fallback */
input[type="color"]::-moz-color-swatch{
  border-radius:6px;
  border:1px solid rgba(0,0,0,0.2);
}

.row{display:flex;gap:6px}
.field.small{flex:1}

/* Reduce spacing between controls (gradiente) and preview */
.row{ gap:4px; } /* compact form controls slightly */

/* Actions */
.actions{display:flex;gap:6px;margin-top:6px}
.btn{
  flex:1;
  padding:8px 10px;
  border-radius:8px;
  font-size:13px;
}
.btn.primary{
  background:linear-gradient(90deg,var(--accent),#6fb5ff20);
  color:#051326;
  border:0;
  box-shadow:0 6px 18px rgba(30,144,255,0.12);
}

/* Preview */
.preview{
  margin-top:4px; /* reduced from 8px to bring preview closer to controls */
  padding:10px;
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
  text-align:center;
}
.qr-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--panel);
  border-radius:12px;
  padding:8px;
  width:100%;
  max-width:280px;
  margin:0 auto;
  overflow:hidden;
  box-sizing:border-box;
  cursor: pointer;
}
/* Prevent tap highlight / touch-callout on the preview and its image/canvas */
.qr-wrap,
.qr-wrap img,
.qr-wrap canvas {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.qr-wrap canvas,
.qr-wrap img {
  width:100% !important;
  height:auto !important;
  max-width:100% !important;
  display:block;
  border-radius:10px; /* slightly rounded preview corners */
}
.hint{margin:8px 0 0;font-size:12px}

/* Preview action buttons */
.preview-actions{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-top:10px;
}
.preview-actions .btn{
  padding:8px 12px;
  border-radius:8px;
  font-size:13px;
  background:transparent;
  border:1px solid rgba(255,255,255,0.06);
  color:inherit;
}

/* Small visual for install button when shown */
#btn-install{
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.02);
  font-weight:600;
}

/* Footer */
.foot{margin-top:8px;font-size:11px; color:#ffffff; text-align:center}
.foot a{color:#ffffff; text-decoration:underline; text-underline-offset:3px}

/* Responsive tweaks for small mobile */
@media (max-width:420px){
  body{padding:8px}
  .top h1{font-size:16px}
  .btn{font-size:13px;padding:8px}
}

.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.55);
  z-index:1000;
  padding:18px;
}
.modal[aria-hidden="false"]{ display:flex; }
.modal-inner{
  width:100%;
  max-width:420px;
  background:var(--panel);
  border-radius:12px;
  padding:14px;
  color:inherit;
  box-shadow:0 8px 30px rgba(0,0,0,0.6);
}
.modal-inner h3{margin:0 0 8px;font-size:15px}
.size-options{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
.size-options label{font-size:14px;color:var(--muted)}
.custom-row input{
  width:100%;
  padding:10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.08);
  background:transparent;
  color:inherit;
  font-size:14px;
}
.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}

.modal-error{
  margin-top:8px;
  padding:10px;
  border-radius:8px;
  background:rgba(255,50,50,0.08);
  color:#ffb3b3;
  font-size:13px;
  display:block;
}