:root {
  --bg: #fffaf4;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --text: #242222;
  --muted: #77716c;
  --line: #eadfd4;
  --orange: #ff830f;
  --orange-dark: #e96e00;
  --orange-soft: #fff1e1;
  --pink: #ff5f79;
  --green: #31b768;
  --purple: #7b61d9;
  --shadow: 0 22px 60px rgba(96, 65, 35, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 201, 139, 0.18), transparent 25%),
    radial-gradient(circle at 92% 88%, rgba(255, 216, 224, 0.22), transparent 27%),
    var(--bg);
    
}
body{
    background-image: url("recursos/bg-landscape.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.app-shell {
  width: min(100%, 1580px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 30px 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 18px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; text-decoration: none; color: inherit; }
.brand img { width: 405px; height: 90px; object-fit: contain; object-position: left center; }
.brand-copy { margin-left: 66px; margin-top: -6px; font-size: 12px; color: #6d5749; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.benefit-pill {
  min-height: 48px; padding: 0 24px; border: 1px solid var(--line); border-radius: 999px;
  display: flex; align-items: center; gap: 28px; background: rgba(255,255,255,.76); box-shadow: 0 10px 30px rgba(88,58,29,.05);
  font-size: 13px; font-weight: 700;
}
.benefit-pill span { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.benefit-pill span:nth-child(1) i { color: var(--pink); }
.benefit-pill span:nth-child(2) i { color: #ffb126; }
.benefit-pill span:nth-child(3) i { color: #b06ee3; }
.icon-button { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); cursor: pointer; box-shadow: 0 10px 30px rgba(88,58,29,.05); }

.workspace { min-height: 0; display: grid; grid-template-columns: minmax(360px, .78fr) minmax(560px, 1.35fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.form-panel { padding: clamp(24px, 2.2vw, 36px); overflow: auto; }
.panel-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.sparkles { color: #ffb52d; font-size: 30px; line-height: 1; }
.panel-heading h1 { font-size: clamp(45px, 2.25vw, 38px); line-height: 1.00; letter-spacing: -.04em; }
.panel-heading h1 span { color: var(--orange); }
.panel-heading p { margin-top: 8px; color: var(--muted); font-size: 14px; }

.qr-form { display: grid; gap: 17px; }
.field-group { display: grid; gap: 8px; }
.field-group label, .quick-options legend { font-size: 13px; font-weight: 800; }
.optional { color: var(--muted); font-weight: 500; }
.field-group small { color: #98908a; font-size: 11px; line-height: 1.45; }
.input-with-icon { height: 54px; position: relative; display: flex; align-items: center; }
.input-with-icon > i { position: absolute; left: 17px; color: #777; }
.input-with-icon input { width: 100%; height: 100%; padding: 0 46px; border: 1px solid var(--line); border-radius: 16px; outline: none; background: rgba(255,255,255,.9); }
.input-with-icon input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255,131,15,.09); }
.input-with-icon input.has-error { border-color: #e85f64; }
.clear-input { position: absolute; right: 14px; border: 0; background: transparent; color: #98908a; cursor: pointer; }

.color-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.color-control { display: flex; height: 52px; min-width: 218px; border: 1px solid var(--line); border-radius: 15px; background: #fff; overflow: hidden; }
.color-control input[type="color"] { width: 66px; height: 100%; padding: 8px; border: 0; border-right: 1px solid var(--line); background: #fff; cursor: pointer; }
.color-control input[type="text"] { width: 145px; border: 0; padding: 0 16px; outline: none; font-weight: 700; }
.swatches { display: flex; gap: 9px; align-items: center; }
.swatch { width: 28px; height: 28px; border: 3px solid transparent; border-radius: 50%; background: var(--swatch); cursor: pointer; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.swatch.active { outline: 2px solid var(--orange); outline-offset: 3px; }

.upload-box { min-height: 88px; border: 1px dashed #dfd2c8; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 14px; background: rgba(255,255,255,.46); cursor: pointer; text-align: left; }
.upload-box > i { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; font-size: 20px; color: #7b7774; background: #fff; }
.upload-box span { display: grid; gap: 2px; }
.upload-box input { display: none; }
.upload-preview { display: flex; align-items: center; gap: 10px; }
.upload-preview img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.upload-preview button { border: 0; background: transparent; color: #cc5c4b; cursor: pointer; font-size: 12px; font-weight: 700; }

.quick-options { border: 0; display: grid; gap: 8px; }
.quick-options legend { margin-bottom: 2px; }
.toggle-row { min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.66); cursor: pointer; }
.toggle-row > span:first-of-type { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.toggle-row > span:first-of-type i { color: #8c8782; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle { width: 38px; height: 22px; padding: 3px; border-radius: 999px; background: #dedbd8; transition: .2s ease; }
.toggle::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: .2s ease; }
.toggle-row input:checked + .toggle { background: var(--orange); }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }
.toggle-row:has(input:checked) { border-color: rgba(255,131,15,.5); background: #fff9f2; }

.generate-button { height: 54px; border: 0; border-radius: 16px; background: linear-gradient(135deg, #ff970f, #ff7607); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 15px 30px rgba(255,126,9,.22); transition: transform .2s ease, box-shadow .2s ease; }
.generate-button:hover { transform: translateY(-2px); box-shadow: 0 20px 38px rgba(255,126,9,.28); }
.privacy-note { text-align: center; color: #aaa39d; font-size: 10px; }

.result-panel { min-height: 0; padding: 18px 24px 16px; position: relative; display: grid; grid-template-rows: minmax(0,1fr) auto auto; align-items: center; justify-items: center; overflow: hidden; background:
  radial-gradient(circle at 82% 35%, rgba(255,221,177,.28), transparent 30%),
  radial-gradient(circle at 18% 78%, rgba(255,211,222,.18), transparent 25%),
  rgba(255,253,249,.88);
}
.result-panel::before, .result-panel::after { content: "🐾"; position: absolute; color: rgba(255,154,55,.12); font-size: 46px; transform: rotate(-16deg); }
.result-panel::before { right: 8%; top: 42%; }
.result-panel::after { right: 16%; bottom: 10%; font-size: 32px; }
.mascot-wrap{
    position:absolute;
    z-index:10;
    left:50%;
    top:35px;
    transform:translateX(-50%);
    width:580px;
    pointer-events:none;
}

.mascot-wrap img{
    display:block;
    width:100%;
    height:auto;
        transform:scale(1.85);

}
.speech-bubble { position: absolute; top: 34px; left: 95%; width: 130px; padding: 16px; border-radius: 17px; background: #fff; box-shadow: 0 14px 35px rgba(91,63,36,.09); transform: rotate(5deg); text-align: center; font-weight: 700; }
.speech-bubble span { display: block; margin-top: 6px; color: var(--orange); }

.result-card {
  margin-top: 80px;
  width: min(72%, 500px);
  min-height: 460px;
  padding: 28px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(255,255,255,.92);
  border: 1px solid #f0e3d8;
  box-shadow: 0 24px 55px rgba(85,58,31,.09);
}
.result-title { font-size: 18px; font-weight: 800; text-align: center; }
.qr-result {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 22px;
  overflow: visible;
  background: #fff;
  flex-shrink: 0;
}
.qr-result canvas,
.qr-result svg {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.empty-qr { width: 100%; height: 100%; border: 1px dashed #e4d8ce; border-radius: 22px; display: grid; place-items: center; align-content: center; gap: 12px; color: #b4aaa2; }
.empty-qr i { font-size: 70px; opacity: .25; }
.empty-qr span { font-size: 13px; }

.download-section { width: 100%; margin-top: 10px; }
.download-heading { margin-bottom: 9px; text-align: center; color: #67615c; font-size: 12px; font-weight: 700; }
.download-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.format-card { min-height: 90px; padding: 11px; border: 1px solid var(--line); border-radius: 17px; display: grid; grid-template-columns: 34px 1fr 28px; grid-template-rows: auto auto; align-items: center; text-align: left; background: #fff; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.format-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(85,58,31,.08); }
.format-card:disabled { opacity: .42; cursor: not-allowed; }
.format-card > i { grid-row: 1 / 3; font-size: 25px; }
.format-card strong { font-size: 14px; }
.format-card span { color: var(--muted); font-size: 10px; }
.format-card em { grid-column: 3; grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-style: normal; background: rgba(0,0,0,.035); }
.format-card.png > i, .format-card.png em { color: var(--orange); }
.format-card.svg > i, .format-card.svg em { color: var(--green); }
.format-card.webp > i, .format-card.webp em { color: var(--purple); }
.result-actions { width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee3da; display: grid; grid-template-columns: repeat(4, 1fr); }
.result-actions button { min-height: 34px; border: 0; border-right: 1px solid #eee3da; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.result-actions button:last-child { border-right: 0; }
.result-actions button:disabled { opacity: .35; cursor: not-allowed; }
.result-actions i { margin-right: 5px; }

.history-panel { border: 1px solid var(--line); border-radius: 22px; padding: 13px 18px; background: rgba(255,255,255,.72); box-shadow: 0 12px 35px rgba(85,58,31,.045); }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.history-heading span { color: var(--orange); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.history-heading h2 { display: none; }
.history-heading button { border: 0; background: transparent; color: #8e867f; font-size: 11px; cursor: pointer; }
.history-heading button:disabled { opacity: .35; }
.history-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.history-item { min-width: 0; padding: 10px; border: 1px solid #eee2d8; border-radius: 15px; display: grid; grid-template-columns: 48px minmax(0,1fr) 28px; align-items: center; gap: 9px; background: #fff; }
.history-item img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; }
.history-info { min-width: 0; display: grid; gap: 3px; }
.history-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.history-info span { color: var(--muted); font-size: 9px; }
.history-item button { width: 28px; height: 28px; border: 0; border-radius: 9px; background: #fff6ec; color: var(--orange); cursor: pointer; }
.empty-history { grid-column: 1 / -1; min-height: 66px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: left; }
.empty-cat { font-size: 32px; }
.empty-history strong { font-size: 12px; color: var(--text); }
.empty-history p { margin-top: 3px; font-size: 10px; }

/*==================================================
FOOTER
==================================================*/

.footer{



    padding:25px 20px 35px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    gap:10px;

    text-align:center;



    backdrop-filter:blur(16px);

    border-radius:28px 28px 28px 28px;
}

.footer-cat{

    width:80px;


    filter:
    drop-shadow(0 15px 30px rgba(0,0,0,.12));
}

.footer h3{

    font-size:14px;
    font-weight: 300;
    color:#000000;
}

.footer p{

    color:#000000;

    font-size:14px;
}

.footer-links{

    display:flex;
    align-items:center;
    justify-content:center;
    gap:24px;

    margin-top:8px;

    flex-wrap:wrap;
}

.footer-links a{

    display:flex;
    align-items:center;
    gap:8px;

    color:#000000;
    text-decoration:none;

    font-size:20px;

    transition:.25s;
}

.footer-links a:hover{

    color:var(--orange);

    transform:translateY(-2px);
}

.footer-links .fa-globe{

    font-size:18px;
}
.dark-mode { --bg: #1c1815; --surface: rgba(39,33,29,.9); --surface-solid: #2b2521; --text: #fff9f4; --muted: #bcb0a6; --line: #493d35; --orange-soft: #49301b; }
.dark-mode .result-panel, .dark-mode .history-panel { background: rgba(39,33,29,.9); }
.dark-mode .result-card, .dark-mode .format-card, .dark-mode .history-item, .dark-mode .color-control, .dark-mode .input-with-icon input { background: #2b2521; }
.dark-mode .qr-result { background: #fff; }

@media (max-width: 1050px) {
  .app-shell { grid-template-rows: auto auto auto auto; }
  .workspace { grid-template-columns: 1fr; }
  .result-panel { min-height: 760px; }
  .history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell { padding: 14px; }
  .topbar { align-items: flex-start; }
  .brand img { width: 155px; height: 44px; }
  .brand-copy { margin-left: 50px; }
  .benefit-pill { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .form-panel { padding: 22px 18px; }
  .result-panel { min-height: 680px; padding: 18px 14px; }
  .speech-bubble { display: none; }
  .result-card { width: 100%; min-height: 390px; margin-top: 75px; }
  .download-grid { gap: 6px; }
  .format-card { grid-template-columns: 1fr; grid-template-rows: auto auto auto; text-align: center; justify-items: center; }
  .format-card > i { grid-row: auto; }
  .format-card em { display: none; }
  .result-actions { grid-template-columns: repeat(2, 1fr); }
  .result-actions button { border-bottom: 1px solid #eee3da; }
  .history-list { grid-template-columns: 1fr; }
  .footer { flex-wrap: wrap; }
}

@media (min-width: 1051px) and (max-height: 850px) {
  .app-shell { padding-top: 14px; gap: 12px; }
  .topbar { min-height: 56px; }
  .brand img { height: 44px; }
  .form-panel { padding: 22px 26px; }
  .qr-form { gap: 11px; }
  .upload-box { min-height: 68px; }
  .toggle-row { min-height: 40px; }
  .generate-button { height: 48px; }
  .result-card { min-height: 340px; margin-top: 60px; }
  .qr-result { width: 100%; max-width: 280px; }
  .mascot-wrap { width: min(31%, 245px); }
  .format-card { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ==================================================
   CORRECCIÓN: MOSTRAR EL QR COMPLETO
================================================== */

.qr-result{
    width:100%;
    max-width:350px;
    aspect-ratio:1 / 1;

    display:flex;
    align-items:center;
    justify-content:center;

    padding:14px;
    overflow:hidden;

    background:#ffffff;
    border-radius:22px;
}

/* Contenedor automático creado por QRCodeStyling */
.qr-result > div{
    width:100% !important;
    height:100% !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    overflow:visible !important;
}

/* QR generado */
.qr-result > div > svg,
.qr-result > div > canvas,
.qr-result svg,
.qr-result canvas{
    display:block !important;

    width:100% !important;
    height:100% !important;

    max-width:100% !important;
    max-height:100% !important;

    object-fit:contain;
}

/* Evita que el QR se comprima dentro de la tarjeta */
.result-card{
    overflow:visible;
}

@media (min-width:1051px) and (max-height:850px){

    .qr-result{
        width:100%;
        max-width:280px;
        padding:12px;
    }

    .qr-result > div{
        width:100% !important;
        height:100% !important;
    }
}