:root{
    --signature-ink:#171717;
    --signature-muted:#6c6863;
    --signature-gold:#986116;
    --signature-gold-dark:#80500f;
    --signature-gold-soft:#c8aa77;
    --signature-paper:#efefed;
    --signature-border:rgba(152,97,22,.58);
    --signature-danger:#7f1616;
}

*,*::before,*::after{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0}
html{background:var(--signature-paper)}
body{
    min-width:280px;
    overflow:hidden;
    background:var(--signature-paper);
    color:var(--signature-ink);
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}
button,input{font:inherit}
button{-webkit-tap-highlight-color:transparent}

.signature-shell{
    position:relative;
    isolation:isolate;
    width:100%;
    height:100vh;
    height:100svh;
    height:100dvh;
    min-height:430px;
    display:grid;
    grid-template-columns:minmax(0,58%) minmax(340px,42%);
    overflow:hidden;
    background:
        linear-gradient(135deg,transparent 0 49.15%,rgba(165,107,23,.86) 49.35% 49.58%,#4a4a4a 49.78%,#292929 72%,#121212 100%) right bottom/39% 23% no-repeat,
        linear-gradient(45deg,#1d1d1d 0 57%,#3f3f3f 70%,rgba(162,105,22,.82) 70.35% 70.65%,rgba(255,255,255,.85) 70.85% 71.1%,transparent 71.35%) left bottom/25% 19% no-repeat,
        radial-gradient(circle at 39% 24%,#fff 0,#f8f8f6 34%,#eeeeeb 68%,#e1e1de 100%);
}
.signature-shell::before{
    content:"";
    position:absolute;
    z-index:-1;
    inset:0;
    pointer-events:none;
    background:
        linear-gradient(128deg,transparent 0 84.6%,rgba(255,255,255,.7) 84.7% 84.82%,transparent 84.94%) right bottom/39% 23% no-repeat,
        linear-gradient(52deg,transparent 0 70.2%,rgba(255,255,255,.72) 70.35% 70.48%,transparent 70.63%) left bottom/25% 19% no-repeat;
    opacity:.78;
}

.signature-brand,
.signature-access{
    position:relative;
    z-index:1;
    min-width:0;
    min-height:0;
    background:transparent;
}

.signature-brand{
    display:grid;
    place-items:center;
    padding:clamp(18px,3vw,48px);
    container-type:inline-size;
}
.signature-brand-content{
    width:min(82%,620px);
    height:min(78dvh,560px);
    min-height:0;
    display:grid;
    grid-template-rows:minmax(0,1fr) auto;
    align-items:center;
    justify-items:center;
    text-align:center;
}
.signature-logo-frame{
    width:100%;
    min-height:0;
    display:grid;
    place-items:end center;
    overflow:visible;
}
.signature-logo{
    display:block;
    width:min(100%,560px);
    max-width:100%;
    max-height:min(56dvh,420px);
    height:auto;
    object-fit:contain;
    object-position:center;
    user-select:none;
    -webkit-user-drag:none;
    filter:drop-shadow(0 10px 12px rgba(0,0,0,.13));
}
.signature-brand-copy{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:clamp(5px,1vh,11px);
    padding-top:clamp(4px,.8vh,9px);
}
.signature-welcome{
    margin:0;
    font-family:Georgia,"Times New Roman",serif;
    font-size:clamp(1.08rem,2vw,1.85rem);
    line-height:1.05;
    color:#171717;
}
.signature-title{
    margin:0;
    white-space:nowrap;
    font-family:Georgia,"Times New Roman",serif;
    font-size:clamp(1.55rem,3.65vw,3.05rem);
    font-weight:600;
    letter-spacing:.035em;
    line-height:1.02;
    color:#171717;
}
.signature-ornament{
    width:min(46%,285px);
    height:16px;
    display:flex;
    align-items:center;
    gap:10px;
}
.signature-ornament::before,.signature-ornament::after{
    content:"";
    height:1px;
    flex:1;
    background:linear-gradient(90deg,transparent,rgba(155,98,20,.9));
}
.signature-ornament::after{transform:scaleX(-1)}
.signature-ornament span{
    width:10px;
    height:10px;
    transform:rotate(45deg);
    border:2px solid var(--signature-gold);
    flex:0 0 auto;
}
.signature-tagline{
    margin:0;
    color:var(--signature-gold-dark);
    font-family:Georgia,"Times New Roman",serif;
    font-size:clamp(.94rem,1.65vw,1.34rem);
    font-weight:600;
    line-height:1.18;
}

.signature-access{
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    display:grid;
    place-items:center;
    padding:
        max(clamp(34px,5.5vh,64px),env(safe-area-inset-top))
        max(clamp(20px,3.8vw,54px),env(safe-area-inset-right))
        max(clamp(20px,3.5vh,40px),env(safe-area-inset-bottom))
        max(clamp(20px,3.8vw,54px),env(safe-area-inset-left));
}
.signature-access-stack{
    width:min(100%,372px);
    margin:auto;
    display:grid;
    gap:15px;
    align-content:center;
}
.signature-card{
    position:relative;
    width:100%;
    border:1px solid var(--signature-border);
    border-radius:18px;
    padding:54px 29px 24px;
    background:rgba(250,250,248,.965);
    box-shadow:0 15px 34px rgba(0,0,0,.14),inset 0 1px 0 #fff;
}
.signature-logo-badge{
    position:absolute;
    left:50%;
    top:0;
    transform:translate(-50%,-50%);
    width:76px;
    height:76px;
    border-radius:50%;
    display:grid;
    place-items:center;
    overflow:hidden;
    background:#f9f9f7;
    border:1px solid rgba(95,95,95,.26);
    box-shadow:0 6px 16px rgba(0,0,0,.09),inset 0 0 0 7px rgba(255,255,255,.72);
}
.signature-logo-badge img{
    display:block;
    width:56%;
    height:56%;
    object-fit:contain;
    object-position:center;
    user-select:none;
    -webkit-user-drag:none;
}
.signature-kicker{
    margin:5px 0 0;
    color:var(--signature-gold-dark);
    text-align:center;
    font-size:.82rem;
    font-weight:760;
    letter-spacing:.13em;
    line-height:1.25;
    text-transform:uppercase;
}
.signature-divider{
    width:44px;
    height:2px;
    margin:16px auto 24px;
    background:linear-gradient(90deg,var(--signature-gold) 0 42%,transparent 42% 58%,#c8b48d 58% 100%);
}
.signature-form{display:grid;gap:14px}
.signature-field{position:relative}
.signature-field label,.signature-visually-hidden{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}
.signature-field input{
    width:100%;
    height:54px;
    border:1px solid rgba(80,80,80,.28);
    border-radius:7px;
    background:rgba(255,255,255,.86);
    color:#1d1d1d;
    padding:0 48px 0 50px;
    outline:none;
    font-size:.91rem;
    transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.signature-field input::placeholder{color:#898681;opacity:1}
.signature-field input:focus{
    border-color:#9d681c;
    background:#fff;
    box-shadow:0 0 0 3px rgba(157,104,28,.12);
}
.field-icon{
    pointer-events:none;
    position:absolute;
    left:16px;
    top:50%;
    transform:translateY(-50%);
    width:20px;
    height:20px;
    stroke:#444;
    fill:none;
    stroke-width:1.7;
}
.signature-password-reveal{
    position:absolute;
    right:7px;
    top:50%;
    transform:translateY(-50%);
    width:39px;
    height:39px;
    display:grid;
    place-items:center;
    border:0;
    border-radius:50%;
    background:transparent;
    color:#76716d;
    cursor:pointer;
    touch-action:none;
    user-select:none;
    -webkit-user-select:none;
}
.signature-password-reveal:hover,.signature-password-reveal:focus-visible{
    background:rgba(0,0,0,.055);
    outline:2px solid rgba(155,98,20,.2);
}
.signature-password-reveal svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.65}
.signature-password-reveal .eye-off{display:none}
.signature-password-reveal[aria-pressed="true"] .eye-on{display:none}
.signature-password-reveal[aria-pressed="true"] .eye-off{display:block}
.signature-org{margin-top:-2px;color:#625e59;font-size:.75rem}
.signature-org summary{
    cursor:pointer;
    text-align:center;
    list-style:none;
    text-decoration:underline;
    text-decoration-color:rgba(152,97,22,.44);
    text-underline-offset:3px;
}
.signature-org summary::-webkit-details-marker{display:none}
.signature-org[open] summary{margin-bottom:9px}
.signature-org input{
    width:100%;
    height:42px;
    border:1px solid rgba(80,80,80,.25);
    border-radius:6px;
    background:#fff;
    padding:0 12px;
    font-size:.84rem;
    outline:none;
}
.signature-org input:focus{border-color:#9d681c;box-shadow:0 0 0 3px rgba(157,104,28,.1)}
.signature-submit{
    width:100%;
    min-height:54px;
    border:1px solid #171717;
    border-radius:6px;
    background:linear-gradient(180deg,#222,#111);
    color:#fff;
    font-size:.82rem;
    font-weight:720;
    letter-spacing:.12em;
    text-transform:uppercase;
    cursor:pointer;
    box-shadow:0 8px 15px rgba(0,0,0,.18);
    transition:transform .14s ease,box-shadow .14s ease,background .14s ease;
}
.signature-submit:hover{background:linear-gradient(180deg,#2a2a2a,#151515);box-shadow:0 9px 18px rgba(0,0,0,.21)}
.signature-submit:active{transform:translateY(1px)}
.signature-submit-inner{display:flex;align-items:center;justify-content:center;gap:11px}
.signature-submit svg{width:17px;height:17px;stroke:#fff;fill:none;stroke-width:1.7}
.signature-forgot{
    display:block;
    width:100%;
    margin:19px 0 0;
    padding:3px;
    border:0;
    background:transparent;
    color:#3d3a37;
    text-align:center;
    font-family:Georgia,"Times New Roman",serif;
    font-size:.9rem;
    cursor:pointer;
}
.signature-forgot:hover,.signature-forgot:focus-visible{
    color:#895913;
    text-decoration:underline;
    text-underline-offset:3px;
    outline:none;
}
.signature-card .alert{
    border-radius:7px;
    padding:10px 12px;
    margin:0 0 16px;
    font-size:.82rem;
    line-height:1.35;
    background:#f4e7e7;
    color:var(--signature-danger);
    border:1px solid rgba(127,22,22,.16);
}
.signature-card .alert.success{background:#e7f2ea;color:#1a6137}
.signature-card .alert.info{background:#eef0f3;color:#3f4957}

.signature-legal{
    margin:0;
    padding:2px 8px 0;
    color:var(--signature-gold-dark);
    text-align:center;
    font-size:clamp(.64rem,.78vw,.78rem);
    line-height:1.42;
    text-shadow:0 1px 0 rgba(255,255,255,.82);
}
.signature-legal::before{
    content:"";
    display:block;
    width:88%;
    height:1px;
    margin:0 auto 8px;
    background:linear-gradient(90deg,transparent,rgba(157,102,22,.68) 17%,rgba(157,102,22,.68) 83%,transparent);
}

.signature-dialog{
    width:min(calc(100% - 32px),470px);
    border:1px solid rgba(152,97,22,.48);
    border-radius:16px;
    padding:0;
    color:#1d1d1d;
    background:#fafaf8;
    box-shadow:0 24px 70px rgba(0,0,0,.28);
}
.signature-dialog::backdrop{background:rgba(15,15,15,.55)}
.signature-dialog-content{padding:28px}
.signature-dialog h2{margin:0 0 10px;font-family:Georgia,"Times New Roman",serif;font-size:1.45rem}
.signature-dialog p{margin:0;color:#5e5a55;line-height:1.55}
.signature-dialog-note{
    margin-top:14px!important;
    padding:12px;
    border-left:3px solid var(--signature-gold);
    background:#f2eee7;
    color:#48433d!important;
    font-size:.9rem;
}
.signature-dialog-actions{display:flex;justify-content:flex-end;margin-top:22px}
.signature-dialog-close{border:0;border-radius:7px;background:#171717;color:#fff;padding:10px 18px;font-weight:650;cursor:pointer}

@media (min-width:701px) and (max-width:1050px){
    .signature-shell{grid-template-columns:minmax(0,52%) minmax(330px,48%)}
    .signature-brand{padding:20px}
    .signature-brand-content{width:min(88%,540px)}
    .signature-logo{width:min(100%,480px)}
    .signature-access{padding-left:24px;padding-right:24px}
}

/* La composición conserva dos columnas también en teléfonos: identidad a la izquierda y acceso a la derecha. */
@media (max-width:700px){
    .signature-shell{
        min-height:420px;
        grid-template-columns:minmax(0,48%) minmax(0,52%);
        background:
            linear-gradient(135deg,transparent 0 49.15%,rgba(165,107,23,.86) 49.35% 49.58%,#4a4a4a 49.78%,#292929 72%,#121212 100%) right bottom/44% 36% no-repeat,
            linear-gradient(45deg,#1d1d1d 0 57%,#3f3f3f 70%,rgba(162,105,22,.82) 70.35% 70.65%,rgba(255,255,255,.85) 70.85% 71.1%,transparent 71.35%) left bottom/37% 28% no-repeat,
            radial-gradient(circle at 39% 24%,#fff 0,#f8f8f6 34%,#eeeeeb 68%,#e1e1de 100%);
    }
    .signature-shell::before{
        background:
            linear-gradient(128deg,transparent 0 84.6%,rgba(255,255,255,.7) 84.7% 84.82%,transparent 84.94%) right bottom/44% 36% no-repeat,
            linear-gradient(52deg,transparent 0 70.2%,rgba(255,255,255,.72) 70.35% 70.48%,transparent 70.63%) left bottom/37% 28% no-repeat;
    }
    .signature-brand{padding:8px 4px}
    .signature-brand-content{
        width:96%;
        height:auto;
        grid-template-rows:auto auto;
        align-content:center;
    }
    .signature-logo-frame{place-items:center}
    .signature-logo{
        width:96%;
        max-height:34dvh;
        filter:drop-shadow(0 5px 7px rgba(0,0,0,.12));
    }
    .signature-brand-copy{gap:3px;padding-top:2px}
    .signature-welcome{font-size:clamp(.58rem,3.1vw,.82rem)}
    .signature-title{font-size:clamp(.72rem,4.05vw,1.08rem);letter-spacing:.018em}
    .signature-ornament{width:min(60%,105px);height:10px;gap:5px}
    .signature-ornament span{width:7px;height:7px;border-width:1px}
    .signature-tagline{font-size:clamp(.5rem,2.65vw,.72rem);line-height:1.15}

    .signature-access{
        padding:
            max(31px,env(safe-area-inset-top))
            max(6px,env(safe-area-inset-right))
            max(8px,env(safe-area-inset-bottom))
            max(6px,env(safe-area-inset-left));
    }
    .signature-access-stack{width:min(100%,245px);gap:8px}
    .signature-card{border-radius:13px;padding:36px 9px 13px}
    .signature-logo-badge{width:52px;height:52px;box-shadow:0 4px 11px rgba(0,0,0,.08),inset 0 0 0 5px rgba(255,255,255,.72)}
    .signature-logo-badge img{width:58%;height:58%}
    .signature-kicker{margin-top:1px;font-size:clamp(.56rem,2.8vw,.69rem);letter-spacing:.09em}
    .signature-divider{width:33px;margin:10px auto 14px}
    .signature-form{gap:9px}
    .signature-field input{height:42px;padding:0 34px 0 33px;font-size:clamp(.64rem,2.85vw,.75rem);border-radius:6px}
    .field-icon{left:9px;width:16px;height:16px}
    .signature-password-reveal{right:1px;width:33px;height:33px}
    .signature-password-reveal svg{width:17px;height:17px}
    .signature-org{font-size:clamp(.52rem,2.35vw,.63rem)}
    .signature-org[open] summary{margin-bottom:5px}
    .signature-org input{height:34px;font-size:.66rem;padding:0 7px}
    .signature-submit{min-height:42px;font-size:clamp(.57rem,2.55vw,.68rem);letter-spacing:.09em;border-radius:5px}
    .signature-submit-inner{gap:6px}
    .signature-submit svg{width:14px;height:14px}
    .signature-forgot{margin-top:11px;font-size:clamp(.57rem,2.5vw,.69rem);line-height:1.2}
    .signature-card .alert{padding:6px 7px;margin-bottom:9px;font-size:.63rem}
    .signature-legal{font-size:clamp(.48rem,2.05vw,.6rem);line-height:1.28;padding:0 2px}
    .signature-legal::before{width:84%;margin-bottom:5px}
    .signature-dialog-content{padding:22px 18px}
}

@media (max-width:370px){
    .signature-shell{grid-template-columns:minmax(0,46%) minmax(0,54%)}
    .signature-card{padding-left:7px;padding-right:7px}
    .signature-field input{font-size:.64rem}
    .signature-legal{font-size:.48rem}
}

@media (max-height:650px) and (min-width:701px){
    .signature-shell{background-size:39% 15%,25% 12%,auto}
    .signature-shell::before{background-size:39% 15%,25% 12%}
    .signature-brand-content{height:min(76dvh,490px)}
    .signature-logo{max-height:min(50dvh,335px)}
    .signature-access-stack{transform:scale(.91);transform-origin:center}
}
@media (max-height:560px) and (max-width:700px){
    .signature-access{place-items:start center;padding-top:27px}
    .signature-access-stack{transform:scale(.9);transform-origin:top center}
    .signature-logo{max-height:30dvh}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
