*{box-sizing:border-box}
:root{--red:#970014;--bright:#e6001b;--gold:#e8b63d}
html,body{margin:0;width:100%;height:100%;font-family:Arial,Helvetica,sans-serif;background:#17181c;color:#111}
body{display:flex;justify-content:center;overflow-x:hidden;overflow-y:auto}
.screen{width:100%;max-width:480px;min-height:100dvh;background:var(--red);display:flex;flex-direction:column;overflow:visible}
.hero{background-color:var(--red);background-image:url("hero-xv-catem.webp");background-position:center center;background-size:cover;background-repeat:no-repeat;aspect-ratio:3/1;width:100%;min-height:0}
.panel{background:#fff;border-radius:28px 28px 0 0;padding:12px 24px 7px;min-height:0;overflow:hidden;flex:1}
h1{margin:0;text-align:center;font-size:clamp(25px,6.6vw,33px);line-height:1.04;font-weight:900}
h1 span{color:#d5001c}
.subtitle{text-align:center;color:#6f7782;font-size:clamp(13px,3.5vw,16px);line-height:1.22;margin:4px 0 6px}
label{display:block;font-size:clamp(13px,3.6vw,16px);font-weight:800;margin:5px 0 3px}
input,select{width:100%;height:40px;border:1.8px solid #d9dde3;border-radius:9px;background:#fff;padding:0 13px;font-size:16px;color:#17191d;outline:none}
input:focus,select:focus{border-color:#c5001a;box-shadow:0 0 0 2px rgba(197,0,26,.08)}
#curp{text-transform:uppercase}
#submitBtn{width:100%;height:45px;border:0;border-radius:10px;background:var(--bright);color:#fff;font-size:17px;font-weight:800;margin-top:7px;display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer}
#submitBtn:disabled{opacity:.65}
.search{font-size:28px;line-height:1}
.message{min-height:0;text-align:center;font-size:12px;line-height:1.1;margin-top:3px}
.message.error{color:#a40016}
.website{text-align:center;margin:7px 0 0;font-size:13px;color:#666}
.website a{color:#c6001b;font-weight:800;text-decoration:none}
footer{height:42px;display:grid;place-items:center;color:#fff;font-size:16px;font-weight:800;border-top:4px solid var(--gold);background:linear-gradient(#a90016,#75000c)}
.hidden{display:none!important}
.result{text-align:center;padding-top:22px}
.check{width:58px;height:58px;margin:0 auto 9px;border-radius:50%;display:grid;place-items:center;background:#118847;color:#fff;font-size:36px;font-weight:900}
.result h2{margin:0 0 14px;font-size:27px}
.person{font-size:20px;font-weight:900}.company{font-size:17px;color:#666;margin-top:6px}.result p{font-size:14px;color:#666}
.view-invite{width:100%;height:45px;border:0;border-radius:10px;background:var(--bright);color:#fff;font-weight:800;font-size:16px;margin-top:8px;cursor:pointer}
.back{width:100%;height:45px;border:0;border-radius:10px;background:#222;color:#fff;font-weight:800;font-size:16px;margin-top:8px}
@media(max-height:740px){
 .panel{padding-top:8px}.subtitle{margin:2px 0 3px}
 label{margin-top:3px}input,select{height:36px}
 #submitBtn{height:40px;margin-top:4px}.website{margin-top:4px;font-size:12px}
 footer{height:36px;font-size:14px}
}
@media(min-width:700px){.screen{box-shadow:0 0 40px #0008}}


html,body{height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
body{overflow:hidden}.screen{height:100dvh;min-height:0;overflow:hidden}
.hero{flex:0 0 auto;height:min(25dvh,145px);aspect-ratio:auto}
.panel{min-height:0;overflow:hidden;display:flex;flex-direction:column;justify-content:center;padding:clamp(8px,2dvh,16px) 20px}
.panel form{min-height:0}footer{flex:0 0 34px;height:34px}
.result{justify-content:center}.result .check{width:45px;height:45px;font-size:28px}.result h2{font-size:clamp(19px,5vw,26px);margin:5px}.result p{margin:8px}
#catemInvitationScreen{position:fixed;inset:0;z-index:9999;background:#101114;display:none;overflow:hidden}
#catemInvitationScreen.active{display:flex;justify-content:center}
.invite-layout{height:100dvh;max-width:520px;width:100%;display:flex;flex-direction:column;align-items:center;min-height:0;padding:4px 8px env(safe-area-inset-bottom)}
.invite-stage{position:relative;flex:1;min-height:0;max-width:100%;aspect-ratio:2/3;align-self:center}
.invite-stage>img{height:100%;width:100%;object-fit:contain;display:block}
.invite-data{position:absolute;left:21.4%;top:41.2%;width:57.3%;height:39.6%;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;overflow:hidden;text-align:center;font-family:Arial,sans-serif;color:#111}
#catemQr{width:58%;aspect-ratio:1;margin:2% auto 1%}#catemQr canvas,#catemQr img{width:100%!important;height:100%!important;display:block!important}
#catemName{font-size:clamp(8px,1.75dvh,15px);font-weight:900;line-height:1.05;overflow-wrap:anywhere;margin:1% 2%}
.invite-label{font-size:clamp(8px,1.55dvh,13px);font-weight:800;color:#666}
#catemCompany{font-size:clamp(9px,1.8dvh,15px);font-weight:800}
.invite-gate{margin-top:auto;margin-bottom:3%;width:94%;background:#fbe7e9;color:#555;font-size:clamp(8px,1.55dvh,13px);font-weight:800;padding:2%;border-radius:7px}
.invite-gate strong{display:block;font-size:clamp(14px,3.3dvh,27px);color:#b9001d}.invite-gate small{font-size:clamp(7px,1.3dvh,11px)}
.invite-actions{width:100%;flex:0 0 auto;display:flex;gap:7px;align-items:center;padding:5px 0}
.invite-actions button{border:0;border-radius:10px;padding:12px 8px;font-size:14px;font-weight:800;cursor:pointer}
#catemDownload{flex:3;background:#d00020;color:white}#catemBack{flex:1;background:#eee;color:#111}
#downloadStatus{position:absolute;bottom:env(safe-area-inset-bottom);font-size:10px;color:white;background:#111a;margin:0;pointer-events:none}
@media(max-height:650px){.hero{height:17dvh}.subtitle{font-size:12px}.panel{padding:5px 16px}h1{font-size:22px}label{font-size:12px;margin:2px 0}input,select{height:33px}#submitBtn{height:36px}footer{height:27px;flex-basis:27px}}

/* V23: vista previa idéntica al archivo descargado, sin superposiciones HTML */
.invite-stage{width:min(100%,calc((100dvh - 100px)*2/3));height:auto;aspect-ratio:2/3;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center}
.invite-stage>img{width:100%;height:100%;object-fit:contain}
#catemQr{display:none!important}
.invite-actions{padding-bottom:max(6px,env(safe-area-inset-bottom))}

/* V25: portrait approved design, responsive preview; full-resolution image download */
.invite-stage{aspect-ratio:887/1774;width:min(100%,calc((100dvh - 90px)*887/1774));max-height:calc(100dvh - 90px)}
.invite-stage>img{object-fit:contain}


/* Aviso de privacidad siempre visible en la pantalla inicial */
.screen{min-height:100dvh;height:100dvh;overflow:hidden}
.screen>.panel{min-height:0;flex:1 1 auto;overflow:hidden}
.screen>.legal-footer{height:57px!important;min-height:57px;flex:0 0 57px;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:3px 6px max(3px,env(safe-area-inset-bottom));font-size:12px;line-height:1.2}
.privacy-visible{display:block;color:#fff;text-decoration:underline;text-underline-offset:2px;font-size:12px;font-weight:600}
@media(max-height:690px){.screen>.legal-footer{height:48px!important;min-height:48px;flex-basis:48px}}
