@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* MV Kiosko — todo aislado bajo #mvdk para no chocar con el tema */
#mvdk{
  --bg:#d6d6d6; --surface:#e7e7e7; --fg:#262626; --muted:#5f5f5f;
  --accent:#262626; --accent-soft:rgba(38,38,38,.08); --accent-fg:#f2f2f2;
  --line:rgba(38,38,38,.16); --glass:rgba(231,231,231,.7);
  --bad:#b3261e;
  --ease:cubic-bezier(.22,1,.36,1);
}
@media (prefers-color-scheme: dark){
  #mvdk:not([data-theme="light"]){
    --bg:#0a0a0a; --surface:#161616; --fg:#fafafa; --muted:#9a9a9a;
    --accent:#fafafa; --accent-soft:rgba(250,250,250,.08); --accent-fg:#0a0a0a;
    --line:rgba(250,250,250,.14); --glass:rgba(22,22,22,.7);
    --bad:#ff8a80;
    color-scheme:dark;
  }
}
#mvdk[data-theme="dark"]{
  --bg:#0a0a0a; --surface:#161616; --fg:#fafafa; --muted:#9a9a9a;
  --accent:#fafafa; --accent-soft:rgba(250,250,250,.08); --accent-fg:#0a0a0a;
  --line:rgba(250,250,250,.14); --glass:rgba(22,22,22,.7);
  --bad:#ff8a80;
  color-scheme:dark;
}
#mvdk{
  box-sizing:border-box; width:100%;
  min-height:100svh; min-height:100vh;
  background:var(--bg); color:var(--fg);
  font-family:-apple-system,BlinkMacSystemFont,'Poppins','Helvetica Neue',Helvetica,sans-serif;
  display:flex; flex-direction:column; align-items:center;
  padding:0 16px; overflow:hidden;
  -webkit-font-smoothing:antialiased; user-select:none; -webkit-user-select:none;
  transition:background .4s, color .4s;
}
#mvdk *, #mvdk *::before, #mvdk *::after{box-sizing:border-box}
#mvdk [hidden]{display:none!important}
#mvdk button{
  -webkit-appearance:none; appearance:none; margin:0; box-shadow:none;
  text-transform:none; letter-spacing:normal; line-height:1.3;
}
#mvdk .kiosk{
  width:100%; max-width:430px; min-height:100svh; min-height:100vh;
  display:flex; flex-direction:column; position:relative;
}
#mvdk .top{display:flex; align-items:center; justify-content:space-between; padding:20px 4px 8px; gap:10px}
#mvdk .brand{display:flex; align-items:center; gap:10px; min-width:0}
#mvdk .logo{
  width:38px; height:38px; border-radius:11px; overflow:hidden; flex:0 0 auto;
  background:var(--fg); display:grid; place-items:center;
}
#mvdk .logo img{width:100%; height:100%; object-fit:cover; display:block; max-width:100%; border-radius:0}
#mvdk .brand small{color:var(--muted); font-size:12px; letter-spacing:.14em; text-transform:uppercase}
#mvdk .topright{display:flex; align-items:center; gap:8px}
#mvdk .campus{
  font-size:12px; color:var(--muted); background:var(--accent-soft);
  border:1px solid var(--line); padding:6px 12px; border-radius:999px;
  letter-spacing:.06em; white-space:nowrap;
}
#mvdk .theme-btn{
  width:34px; height:34px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface); color:var(--fg); cursor:pointer;
  display:grid; place-items:center; padding:0;
  transition:transform .35s var(--ease), background .3s;
}
#mvdk .theme-btn:active{transform:scale(.9)}
#mvdk .theme-btn svg{width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
#mvdk .theme-btn .moon{display:none}
#mvdk[data-theme="dark"] .theme-btn .sun{display:none}
#mvdk[data-theme="dark"] .theme-btn .moon{display:block}
@media (prefers-color-scheme: dark){
  #mvdk:not([data-theme="light"]) .theme-btn .sun{display:none}
  #mvdk:not([data-theme="light"]) .theme-btn .moon{display:block}
}
#mvdk[data-theme="light"] .theme-btn .sun{display:block}
#mvdk[data-theme="light"] .theme-btn .moon{display:none}
#mvdk .stage{flex:1; position:relative}
#mvdk .pane{
  position:absolute; inset:0; display:flex; flex-direction:column;
  justify-content:center; gap:22px;
}
#mvdk h1{
  font-size:clamp(26px,7vw,34px); font-weight:500; margin:0; color:var(--fg);
  letter-spacing:-.02em; line-height:1.15; text-wrap:balance;
  font-family:inherit; text-transform:none;
}
#mvdk .sub{color:var(--muted); font-size:15px; margin:-12px 0 0; line-height:1.5}
#mvdk .error{color:var(--bad); font-size:14px; margin:-8px 0 0; text-align:center}
#mvdk .seg{
  position:relative; display:grid; grid-template-columns:1fr 1fr 1fr;
  background:var(--surface); border:1px solid var(--line); border-radius:999px;
  padding:4px; width:216px; margin:0 auto;
}
#mvdk .seg .thumb{
  position:absolute; top:4px; bottom:4px; left:4px; width:calc((100% - 8px) / 3);
  background:var(--accent); border-radius:999px;
  transition:transform .45s var(--ease);
}
#mvdk .seg button{
  position:relative; z-index:1; border:0; background:none; font:inherit;
  font-size:13px; font-weight:600; padding:8px 0; border-radius:999px;
  color:var(--muted); cursor:pointer; transition:color .3s;
}
#mvdk .seg[data-cur="USD"] .thumb{transform:translateX(100%)}
#mvdk .seg[data-cur="EUR"] .thumb{transform:translateX(200%)}
#mvdk .seg[data-cur="MXN"] .b-mxn, #mvdk .seg[data-cur="USD"] .b-usd, #mvdk .seg[data-cur="EUR"] .b-eur{color:var(--accent-fg)}
/* vertical: una opción por renglón, a lo ancho; todas las pantallas centradas */
#mvdk .amounts{display:grid; grid-template-columns:1fr; gap:10px}
#mvdk .pane{text-align:center}
#mvdk .amt.extra{display:none}
#mvdk .motives{display:grid; grid-template-columns:1fr; gap:10px}
#mvdk .motive{font-size:21px; padding:18px 10px}
#mvdk .amt, #mvdk .other{
  border:1px solid var(--line); background:var(--surface); color:var(--fg);
  font:inherit; font-size:23px; font-weight:600; font-variant-numeric:tabular-nums;
  padding:22px 10px; border-radius:20px; cursor:pointer;
  transition:transform .35s var(--ease), background .3s, color .3s, border-color .3s;
}
#mvdk .amt span{display:block; font-size:12px; color:var(--muted); margin-top:4px; font-weight:400}
#mvdk .other{
  grid-column:1 / -1; font-size:20px; font-weight:600; padding:24px;
  background:#6e6e6e; color:#ffffff; border-color:transparent;
}
@media (hover:hover){ #mvdk .other:hover{background:#5e5e5e; color:#ffffff; border-color:transparent} }
#mvdk .amt:active, #mvdk .other:active, #mvdk .big:active, #mvdk .key:active{transform:scale(.96)}
@media (hover:hover){ #mvdk .amt:hover, #mvdk .other:hover{border-color:var(--fg); background:var(--surface); color:var(--fg)} }
#mvdk .display{
  font-size:clamp(40px,12vw,56px); font-weight:500; text-align:center; color:var(--fg);
  font-variant-numeric:tabular-nums; letter-spacing:-.02em; min-height:1.3em;
}
#mvdk .display small{font-size:.4em; color:var(--muted); font-weight:400; vertical-align:middle; margin-left:6px}
#mvdk .min-hint{color:var(--bad); font-size:14px; text-align:center; margin:-14px 0 0}
#mvdk .pad{display:grid; grid-template-columns:repeat(3,1fr); gap:10px}
#mvdk .key{
  background:var(--surface); color:var(--fg); font:inherit; font-size:24px;
  font-weight:500; padding:16px 0; border-radius:16px; cursor:pointer;
  border:1px solid var(--line);
  transition:transform .3s var(--ease), background .2s;
}
#mvdk .key.fn{color:var(--muted); font-size:18px}
#mvdk .chips{display:flex; flex-wrap:wrap; gap:8px; justify-content:center}
#mvdk .chip{
  border:1px solid var(--line); background:var(--surface); color:var(--muted);
  font:inherit; font-size:13px; padding:8px 14px; border-radius:999px; cursor:pointer;
  transition:transform .3s var(--ease), color .3s, border-color .3s;
}
#mvdk .chip:active{transform:scale(.94)}
@media (hover:hover){ #mvdk .chip:hover{border-color:var(--fg); color:var(--fg); background:var(--surface)} }
#mvdk input[type=email]{
  width:100%; border:1px solid var(--line); background:var(--surface);
  color:var(--fg); font:inherit; font-size:20px; padding:18px 20px; border-radius:18px;
  outline:none; text-align:center; transition:border-color .3s, box-shadow .3s;
  box-shadow:none; margin:0;
}
#mvdk input[type=email]:focus{border-color:var(--fg); box-shadow:0 0 0 4px var(--accent-soft)}
#mvdk input[type=text]{
  width:100%; border:1px solid var(--line); background:var(--surface);
  color:var(--fg); font:inherit; font-size:20px; padding:18px 20px; border-radius:18px;
  outline:none; text-align:center; transition:border-color .3s, box-shadow .3s;
  box-shadow:none; margin:0;
}
#mvdk input[type=text]:focus{border-color:var(--fg); box-shadow:0 0 0 4px var(--accent-soft)}
#mvdk .big{
  border:0; background:var(--accent); color:var(--accent-fg); font:inherit;
  font-size:18px; font-weight:600; padding:18px; border-radius:999px; cursor:pointer;
  transition:transform .35s var(--ease), opacity .3s; width:100%;
}
#mvdk .big:hover{background:var(--accent); color:var(--accent-fg)}
#mvdk .big:disabled{opacity:.35}
#mvdk .big.secondary{background:var(--surface); color:var(--fg); border:1px solid var(--line)}
@media (hover:hover){ #mvdk .big.secondary:hover{border-color:var(--fg); background:var(--surface); color:var(--fg)} }
#mvdk .ghost{
  border:1px solid var(--line); background:var(--surface); color:var(--fg);
  font:inherit; font-size:16px; font-weight:500;
  padding:16px; cursor:pointer; border-radius:999px; width:100%;
  transition:transform .35s var(--ease), border-color .3s;
}
#mvdk .ghost:active{transform:scale(.97)}
#mvdk .ghost:hover{background:var(--surface); color:var(--fg); border-color:var(--fg)}
#mvdk .ghost:focus-visible, #mvdk .big:focus-visible, #mvdk .amt:focus-visible,
#mvdk .key:focus-visible, #mvdk .other:focus-visible, #mvdk .seg button:focus-visible,
#mvdk .theme-btn:focus-visible{outline:2px solid var(--fg); outline-offset:2px}
#mvdk .stack{display:flex; flex-direction:column; gap:12px}
#mvdk .confirm-card{
  background:var(--glass); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  border:1px solid var(--line); border-radius:28px; padding:28px; text-align:center;
  display:flex; flex-direction:column; gap:6px;
}
#mvdk .confirm-card .amount{font-size:48px; font-weight:300; font-variant-numeric:tabular-nums; letter-spacing:-.02em}
#mvdk .confirm-card .who{color:var(--muted); font-size:14px}
#mvdk .tapwrap{display:grid; place-items:center; padding:30px 0}
#mvdk .nfc{position:relative; width:180px; height:180px; display:grid; place-items:center}
#mvdk .ring{
  position:absolute; inset:0; border-radius:50%; border:1.5px solid var(--fg);
  opacity:0; animation:mvdk-ripple 2.4s var(--ease) infinite;
}
#mvdk .ring:nth-child(2){animation-delay:.8s}
#mvdk .ring:nth-child(3){animation-delay:1.6s}
@keyframes mvdk-ripple{
  0%{transform:scale(.45); opacity:0}
  30%{opacity:.4}
  100%{transform:scale(1.15); opacity:0}
}
#mvdk .nfc-core{
  width:92px; height:92px; border-radius:50%;
  background:var(--accent); display:grid; place-items:center;
  animation:mvdk-breathe 2.4s ease-in-out infinite;
}
@keyframes mvdk-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}
#mvdk .nfc-core svg{width:44px; height:44px; stroke:var(--accent-fg)}
#mvdk .spin{
  width:56px; height:56px; border-radius:50%; margin:20px auto;
  border:3px solid var(--accent-soft); border-top-color:var(--fg);
  animation:mvdk-spin .9s linear infinite;
}
@keyframes mvdk-spin{to{transform:rotate(360deg)}}
#mvdk .check{width:110px; height:110px; margin:0 auto; display:block}
#mvdk .check circle{
  fill:none; stroke:var(--fg); stroke-width:3;
  stroke-dasharray:308; stroke-dashoffset:308;
  animation:mvdk-draw 1s var(--ease) forwards;
}
#mvdk .check path{
  fill:none; stroke:var(--fg); stroke-width:5; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:80; stroke-dashoffset:80;
  animation:mvdk-draw .6s var(--ease) .55s forwards;
}
@keyframes mvdk-draw{to{stroke-dashoffset:0}}
#mvdk .countdown{height:3px; background:var(--accent-soft); border-radius:3px; overflow:hidden; margin-top:28px}
#mvdk .countdown i{display:block; height:100%; background:var(--fg); width:100%;
  transform-origin:left; animation:mvdk-shrink 5s linear forwards}
@keyframes mvdk-shrink{to{transform:scaleX(0)}}
#mvdk .center{text-align:center}
/* ---- protector de pantalla ---- */
#mvdk .saver{
  position:fixed; inset:0; z-index:60; background:var(--bg);
  display:grid; place-items:center; cursor:pointer; overflow:hidden;
  opacity:0; transition:opacity .6s var(--ease);
}
#mvdk .saver.on{opacity:1}
/* fondo: dos resplandores suaves que derivan lentamente */
#mvdk .saver::before, #mvdk .saver::after{
  content:""; position:absolute; width:60vmax; height:60vmax; border-radius:50%;
  background:radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  pointer-events:none;
}
#mvdk .saver::before{top:-25vmax; left:-20vmax; animation:mvdk-drift1 22s ease-in-out infinite alternate}
#mvdk .saver::after{bottom:-28vmax; right:-22vmax; animation:mvdk-drift2 28s ease-in-out infinite alternate}
@keyframes mvdk-drift1{from{transform:translate(0,0) scale(1)} to{transform:translate(14vmax,10vmax) scale(1.25)}}
@keyframes mvdk-drift2{from{transform:translate(0,0) scale(1.2)} to{transform:translate(-12vmax,-10vmax) scale(.95)}}
#mvdk .saver-inner{position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:30px; text-align:center}
#mvdk .saver-logo{
  position:relative; width:125px; height:125px; border-radius:34px;
  background:var(--fg); animation:mvdk-breathe 3.6s ease-in-out infinite;
}
#mvdk .saver-logo img{width:100%; height:100%; object-fit:cover; display:block; border-radius:34px}
/* destello dorado en el borde, solo de vez en cuando */
#mvdk .saver-logo::after{
  content:""; position:absolute; inset:-3px; border-radius:37px; padding:3px;
  background:linear-gradient(115deg, transparent 32%, #f6e27a 44%, #d4af37 50%, #fff3b0 55%, transparent 68%);
  background-size:280% 280%;
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite:exclude;
  opacity:0; pointer-events:none;
  animation:mvdk-gold 14s linear infinite;
}
@keyframes mvdk-gold{
  0%{opacity:0; background-position:220% 50%}
  5%{opacity:1}
  26%{opacity:1; background-position:-80% 50%}
  33%{opacity:0; background-position:-120% 50%}
  100%{opacity:0; background-position:-120% 50%}
}
#mvdk .saver-text{
  color:var(--fg); font-size:clamp(21px,5vw,27px); font-weight:500; letter-spacing:.01em;
  min-height:1.4em; display:flex; align-items:center; justify-content:center;
}
#mvdk .saver-text #mvdk-saver-txt{white-space:pre}
#mvdk #mvdk-saver-txt span{opacity:0; transition:opacity .5s ease}
#mvdk #mvdk-saver-txt span.in{opacity:1}
/* ---- modo horizontal: más montos, rejilla ancha y paneles con scroll ---- */
@media (orientation:landscape) and (min-width:640px){
  #mvdk .kiosk{max-width:none; padding:0 28px}
  #mvdk .top{padding-top:10px; padding-bottom:4px}
  /* el contenido alto se puede desplazar; el corto queda centrado (márgenes auto) */
  #mvdk .pane{gap:14px; justify-content:flex-start; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:6px 2px 16px}
  #mvdk .pane > :first-child{margin-top:auto}
  #mvdk .pane > :last-child{margin-bottom:auto}
  #mvdk h1{font-size:clamp(22px,3.5vw,28px)}
  #mvdk .sub{font-size:14px; margin-top:-8px}
  #mvdk .amounts{grid-template-columns:repeat(4,1fr)}
  #mvdk .amt{padding:16px 10px; font-size:20px}
  #mvdk .amt.extra{display:block}
  #mvdk .other{padding:16px; font-size:18px}
  #mvdk .motives{grid-template-columns:repeat(4,1fr)}
  /* "Otra cantidad": dos columnas a lo ancho — monto y botones a la izquierda, teclado a la derecha */
  #mvdk #mvdk-p-custom{
    display:grid; grid-template-columns:1fr 1.25fr; grid-template-rows:auto auto auto;
    grid-template-areas:"disp pad" "hint pad" "stack pad";
    column-gap:36px; row-gap:18px; align-content:center; align-items:center;
    overflow:hidden; padding:0;
  }
  #mvdk #mvdk-p-custom > :first-child{margin-top:0}
  #mvdk #mvdk-p-custom > :last-child{margin-bottom:0}
  #mvdk #mvdk-p-custom .display{grid-area:disp; font-size:clamp(38px,6vw,52px); min-height:1.2em}
  #mvdk #mvdk-p-custom .min-hint{grid-area:hint; margin:0}
  #mvdk #mvdk-p-custom .pad{grid-area:pad; width:100%; max-width:none; margin:0; gap:10px}
  #mvdk #mvdk-p-custom .stack{grid-area:stack; flex-direction:column; max-width:320px; width:100%; margin:0 auto}
  #mvdk .key{padding:12px 0; font-size:20px; border-radius:14px}
  #mvdk .key.fn{font-size:16px}
  #mvdk .stack{flex-direction:row; max-width:480px; width:100%; margin:0 auto}
  #mvdk .stack .big{padding:13px; font-size:16px}
  #mvdk .stack .ghost{width:auto; flex:0 0 auto; padding:13px 18px}
  #mvdk #mvdk-p-custom .stack .big{width:100%}
  #mvdk #mvdk-p-custom .stack .ghost{width:100%}
  #mvdk input[type=email]{max-width:480px; margin:0 auto; padding:13px 18px; font-size:18px}
  /* nombre: sin título, el campo grande a lo ancho hace de pregunta, todo centrado vertical */
  #mvdk #mvdk-p-name{justify-content:center; overflow:visible; gap:20px}
  #mvdk #mvdk-p-name > :first-child{margin-top:0}
  #mvdk #mvdk-p-name > :last-child{margin-bottom:0}
  #mvdk #mvdk-p-name h1, #mvdk #mvdk-p-name .sub{display:none}
  #mvdk #mvdk-p-name input[type=text]{width:100%; max-width:none; margin:0; padding:38px 30px; font-size:27px; border-radius:26px}
  #mvdk #mvdk-p-name .stack{max-width:none; width:100%; margin:0}
  #mvdk #mvdk-p-name .stack .big{padding:18px; font-size:18px}
  #mvdk .chips{max-width:520px; margin:0 auto}
  #mvdk .confirm-card{max-width:480px; width:100%; margin:0 auto; padding:18px}
  #mvdk .confirm-card .amount{font-size:38px}
  #mvdk .tapwrap{padding:10px 0}
  #mvdk .nfc{width:130px; height:130px}
  #mvdk .nfc-core{width:70px; height:70px}
  #mvdk .countdown{max-width:480px; width:100%; margin:16px auto 0}
}
@media (max-width:360px){
  #mvdk .campus{display:none}
  #mvdk .amt{padding:18px 8px; font-size:20px}
}
@media (prefers-reduced-motion:reduce){
  #mvdk *, #mvdk *::before, #mvdk *::after{animation-duration:.01ms!important; transition-duration:.01ms!important}
}
