/* SignumDigital — Login: Security Scan (láser · borde perimetral · HUD) */

@property --sd-scan-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@media (prefers-reduced-motion: reduce) {
    .sd-scan-stage *,
    .sd-vault-card,
    .sd-corner,
    .sd-scan-status-line,
    .sd-login-title,
    .sd-btn-auth::after,
    .sd-btn-auth-bar,
    .sd-btn-auth-spinner {
        animation: none !important;
        transition: none !important;
    }
    .sd-input-scan-wrap.sd-typing,
    .sd-input-scan-wrap.sd-key-hit,
    .sd-char-flash,
    .sd-pass-decipher,
    .sd-dec-char,
    .sd-pass-decipher.is-fading-out {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    .pass-toggle-label {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }
    .sd-scan-stage {
        display: none !important;
    }
    .sd-vault-card {
        opacity: 1 !important;
    }
}

/* —— Escenario full-screen —— */
.sd-login-page {
    position: relative;
    overflow: hidden;
    background-color: #05070a;
}

.sd-scan-stage {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sd-scan-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, rgba(5, 7, 10, 0.55) 100%);
}

.sd-scan-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.45;
    animation: sdGridPulse 6s ease-in-out infinite;
}

@keyframes sdGridPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.55; }
}

.sd-scan-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.12) 3px,
        rgba(0, 0, 0, 0.12) 4px
    );
    opacity: 0.35;
}

.sd-scan-laser-trail {
    position: fixed;
    left: -5%;
    right: -5%;
    height: 120px;
    top: -60px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 229, 255, 0.03) 35%,
        rgba(0, 229, 255, 0.12) 50%,
        rgba(0, 229, 255, 0.03) 65%,
        transparent 100%
    );
    filter: blur(2px);
    animation: sdLaserMove 1.15s cubic-bezier(0.45, 0.05, 0.2, 1) 0.12s 1 forwards;
    z-index: 2;
}

.sd-scan-laser {
    position: fixed;
    left: 0;
    right: 0;
    height: 2px;
    top: -4px;
    z-index: 3;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 229, 255, 0.4) 20%,
        #fff 50%,
        rgba(0, 229, 255, 0.4) 80%,
        transparent 100%
    );
    box-shadow:
        0 0 8px #00e5ff,
        0 0 22px rgba(0, 229, 255, 0.75),
        0 0 48px rgba(41, 121, 255, 0.35);
    animation: sdLaserMove 1.15s cubic-bezier(0.45, 0.05, 0.2, 1) 0.12s 1 forwards;
}

.sd-scan-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.14), transparent 55%);
    opacity: 0;
    animation: sdScanFlash 0.35s ease-out 0.55s 1 forwards;
    z-index: 1;
}

@keyframes sdLaserMove {
    to { top: calc(100% + 4px); }
}

@keyframes sdScanFlash {
    0% { opacity: 0; }
    35% { opacity: 1; }
    100% { opacity: 0; }
}

/* —— Tarjeta vault —— */
.sd-login-page .login-container {
    position: relative;
    z-index: 10;
}

.sd-vault-card {
    opacity: 0;
    transform: scale(0.96) translateY(14px);
    filter: brightness(1.15);
    animation: sdVaultReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.72s forwards;
}

@keyframes sdVaultReveal {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: brightness(1);
    }
}

.sd-vault-card::before {
    animation: sdVaultBarPulse 1.2s ease-out 0.95s 1;
}

@keyframes sdVaultBarPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(51, 51, 255, 0.7);
    }
    50% {
        box-shadow:
            0 0 24px rgba(0, 229, 255, 0.85),
            0 0 40px rgba(255, 0, 204, 0.35);
    }
}

/* Esquinas HUD */
.sd-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0;
    animation: sdCornerPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}

.sd-corner-tl {
    top: 12px;
    left: 12px;
    border-top: 2px solid #00e5ff;
    border-left: 2px solid #00e5ff;
    animation-delay: 0.88s;
    box-shadow: -2px -2px 8px rgba(0, 229, 255, 0.35);
}

.sd-corner-tr {
    top: 12px;
    right: 12px;
    border-top: 2px solid #00e5ff;
    border-right: 2px solid #00e5ff;
    animation-delay: 0.94s;
    box-shadow: 2px -2px 8px rgba(0, 229, 255, 0.35);
}

.sd-corner-bl {
    bottom: 12px;
    left: 12px;
    border-bottom: 2px solid #2979ff;
    border-left: 2px solid #2979ff;
    animation-delay: 1s;
    box-shadow: -2px 2px 8px rgba(41, 121, 255, 0.35);
}

.sd-corner-br {
    bottom: 12px;
    right: 12px;
    border-bottom: 2px solid #2979ff;
    border-right: 2px solid #2979ff;
    animation-delay: 1.06s;
    box-shadow: 2px 2px 8px rgba(41, 121, 255, 0.35);
}

@keyframes sdCornerPop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Status terminal */
.sd-scan-status {
    margin: 0 0 22px;
    padding: 0;
    text-align: left;
    min-height: 52px;
    font-family: 'Rajdhani', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #00e5ff;
    line-height: 1.55;
}

.sd-scan-status-line {
    display: block;
    opacity: 0;
    transform: translateX(-6px);
    animation: sdStatusLine 0.4s ease-out forwards;
}

.sd-scan-status-line:nth-child(1) { animation-delay: 0.82s; color: #6a7b92; }
.sd-scan-status-line:nth-child(2) { animation-delay: 1.02s; color: #8b9eb0; }
.sd-scan-status-line:nth-child(3) { animation-delay: 1.22s; color: #00e676; text-shadow: 0 0 12px rgba(0, 230, 118, 0.35); }

@keyframes sdStatusLine {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Título */
.sd-login-title {
    position: relative;
    display: inline-block;
    margin-bottom: 8px !important;
    animation: sdTitleGlow 0.5s ease-out 1.05s 1 forwards;
}

@keyframes sdTitleGlow {
    from { filter: drop-shadow(0 0 0 transparent); }
    to { filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.45)); }
}

.sd-login-title::after {
    content: '_';
    display: inline-block;
    margin-left: 2px;
    color: #00e5ff;
    -webkit-text-fill-color: #00e5ff;
    font-weight: 400;
    animation: sdCursorBlink 1s step-end 1.3s infinite;
}

@keyframes sdCursorBlink {
    50% { opacity: 0; }
}

.sd-login-sub {
    margin: 0 0 28px;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4e6580;
    font-family: 'Share Tech Mono', monospace;
    opacity: 0;
    animation: sdStatusLine 0.35s ease-out 1.15s forwards;
}

/* Labels security — estilo vault login */
.sd-label-secure {
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 10px !important;
    letter-spacing: 0.14em !important;
    color: #4e6580 !important;
    opacity: 1;
    font-weight: 400 !important;
}

/* Input — borde perimetral en rotación al focus */
.sd-input-scan-wrap {
    position: relative;
    border-radius: 11px;
    isolation: isolate;
}

.sd-input-scan-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 11px;
    padding: 1.5px;
    background: conic-gradient(
        from var(--sd-scan-angle),
        transparent 0deg,
        transparent 250deg,
        #00e5ff 285deg,
        #2979ff 310deg,
        #d500f9 335deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.28s ease;
    z-index: 0;
}

.sd-input-scan-wrap::after {
    content: '';
    position: absolute;
    inset: 1.5px;
    border-radius: 10px;
    background: rgba(5, 12, 22, 0.95);
    z-index: 0;
    pointer-events: none;
    transition: box-shadow 0.22s ease, background 0.22s ease;
}

/* Brillo suave al escribir (campo con foco y contenido) */
.sd-input-scan-wrap:focus-within:has(.sd-input-secure:not(:placeholder-shown))::after {
    background: rgba(7, 17, 30, 0.94);
    box-shadow: inset 0 0 22px rgba(0, 229, 255, 0.07);
}

/* Pulso al escribir o borrar un carácter */
.sd-input-scan-wrap.sd-key-hit::after,
.sd-input-scan-wrap.sd-typing::after {
    background: rgba(8, 20, 34, 0.93);
    box-shadow:
        inset 0 0 28px rgba(0, 229, 255, 0.16),
        inset -20px 0 32px rgba(0, 229, 255, 0.08);
}

.sd-input-scan-wrap.sd-key-hit::after {
    animation: sdKeyHitGlow 0.38s ease-out;
}

.sd-input-scan-wrap.sd-typing .sd-input-secure {
    animation: sdCharPop 0.22s ease-out;
}

.sd-char-flash {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 16px;
    margin-top: -8px;
    background: #00e5ff;
    box-shadow:
        0 0 8px #00e5ff,
        0 0 18px rgba(0, 229, 255, 0.75);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    animation: sdCharFlash 0.32s ease-out forwards;
    left: 14px;
    right: auto;
}

.sd-input-measure {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    top: 0;
    left: 0;
    height: 0;
    overflow: hidden;
    white-space: pre;
}

/* Toggle Ver / Ocultar contraseña — solo estados, sin tocar posición */
.pass-toggle-btn.is-deciphering {
    color: #00e5ff !important;
    border-color: rgba(0, 229, 255, 0.65) !important;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.25), inset 0 0 12px rgba(0, 229, 255, 0.1) !important;
    pointer-events: none;
    transform: translateY(-50%) scale(0.98);
}

.pass-toggle-btn.is-hiding {
    pointer-events: none;
    opacity: 0.82;
    transform: translateY(-50%) scale(0.98);
    border-color: rgba(0, 229, 255, 0.4) !important;
    transition:
        opacity 0.44s ease,
        transform 0.34s ease,
        border-color 0.34s ease,
        box-shadow 0.34s ease;
}

@keyframes sdKeyHitGlow {
    0% {
        box-shadow:
            inset 0 0 36px rgba(0, 229, 255, 0.26),
            inset -26px 0 40px rgba(0, 229, 255, 0.14),
            0 0 20px rgba(0, 229, 255, 0.12);
    }
    100% {
        box-shadow:
            inset 0 0 22px rgba(0, 229, 255, 0.07),
            inset 0 0 0 transparent,
            0 0 0 transparent;
    }
}

@keyframes sdCharPop {
    0% { text-shadow: 0 0 18px rgba(0, 229, 255, 1), 0 0 6px #00e5ff; }
    55% { text-shadow: 0 0 12px rgba(0, 229, 255, 0.65); }
    100% { text-shadow: 0 0 10px rgba(0, 229, 255, 0.58); }
}

@keyframes sdCharFlash {
    0% { opacity: 0.95; transform: scaleY(1.15); }
    100% { opacity: 0; transform: scaleY(0.4); }
}

/* —— Descifrado progresivo (Ver contraseña) —— */
.sd-pass-decipher {
    position: absolute;
    inset: 0;
    padding: 12px 14px;
    z-index: 2;
    pointer-events: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0.06em;
    color: #00e5ff;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    border-radius: 10px;
}

.sd-input-scan-wrap.has-toggle .sd-pass-decipher {
    padding-right: var(--sd-toggle-pad, 132px);
}

.sd-input-scan-wrap.has-toggle .sd-input-secure.sd-input-pass {
    transition:
        border-color 0.25s,
        box-shadow 0.25s,
        text-shadow 0.2s,
        padding-right 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sd-glass-page.sd-login-page .sd-input-scan-wrap.sd-pass-deciphering input.sd-input-secure,
.sd-glass-page.theme-auth .sd-input-scan-wrap.sd-pass-deciphering input.sd-input-secure,
.sd-input-scan-wrap.sd-pass-deciphering .sd-input-secure {
    color: transparent !important;
    text-shadow: none !important;
    -webkit-text-fill-color: transparent !important;
}

.sd-input-scan-wrap.sd-pass-deciphering:not(:focus-within) .sd-input-secure,
.sd-input-scan-wrap.sd-pass-hiding:not(:focus-within) .sd-input-secure {
    caret-color: transparent !important;
}

.sd-input-scan-wrap.sd-pass-deciphering:focus-within .sd-input-secure,
.sd-input-scan-wrap.sd-pass-hiding:focus-within .sd-input-secure {
    caret-color: #00e5ff !important;
}

.sd-input-scan-wrap.sd-pass-deciphering::after {
    box-shadow: inset 0 0 28px rgba(0, 229, 255, 0.08);
}

.sd-dec-char.is-scrambling {
    color: #4a7a9a;
    text-shadow: 0 0 4px rgba(41, 121, 255, 0.35);
}

.sd-dec-char.is-locked {
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
}

.sd-dec-char.sd-dec-just-locked {
    animation: sdDecCharLock 0.32s ease-out;
}

@keyframes sdDecCharLock {
    0% {
        color: #fff;
        text-shadow: 0 0 16px rgba(0, 229, 255, 0.95), 0 0 4px #00e5ff;
        transform: scale(1.18);
    }
    100% {
        color: #00e5ff;
        text-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
        transform: scale(1);
    }
}

/* Ocultar contraseña — desvanecido suave + blur */
.sd-pass-decipher.sd-pass-fade-text {
    display: flex;
    align-items: center;
}

.sd-pass-decipher.is-fading-out {
    animation: sdPassFadeOut 0.44s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: opacity, filter;
}

.sd-glass-page.sd-login-page .sd-input-scan-wrap.sd-pass-hiding input.sd-input-secure,
.sd-glass-page.theme-auth .sd-input-scan-wrap.sd-pass-hiding input.sd-input-secure,
.sd-input-scan-wrap.sd-pass-hiding .sd-input-secure {
    color: transparent !important;
    text-shadow: none !important;
    -webkit-text-fill-color: transparent !important;
}

.sd-input-scan-wrap.sd-pass-hiding::after {
    box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.05);
    transition: box-shadow 0.44s ease;
}

@keyframes sdPassFadeOut {
    0% {
        opacity: 1;
        filter: blur(0);
        text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    }
    100% {
        opacity: 0;
        filter: blur(4px);
        text-shadow: 0 0 12px rgba(0, 229, 255, 0);
    }
}

.sd-input-scan-wrap:focus-within::before {
    opacity: 1;
    animation: sdScanBorderRotate 2.4s linear infinite;
}

@keyframes sdScanBorderRotate {
    to { --sd-scan-angle: 360deg; }
}

.sd-input-scan-wrap .sd-input-secure {
    position: relative;
    z-index: 1;
    border: 1px solid #0e2035 !important;
    background: transparent !important;
    color: #00e5ff !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 14px !important;
    letter-spacing: 0.06em;
    caret-color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.52);
    transition: border-color 0.25s, box-shadow 0.25s, text-shadow 0.2s !important;
}

.sd-input-scan-wrap .sd-input-secure.sd-input-pass[type="password"] {
    -webkit-text-security: square;
    letter-spacing: 0.12em;
}

.sd-input-scan-wrap:focus-within .sd-input-secure {
    border-color: rgba(0, 229, 255, 0.52) !important;
    box-shadow:
        inset 0 0 22px rgba(0, 229, 255, 0.07),
        0 0 20px rgba(0, 229, 255, 0.18) !important;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.68);
}

.sd-input-scan-wrap:focus-within.sd-key-hit .sd-input-secure,
.sd-input-scan-wrap:focus-within.sd-typing .sd-input-secure {
    border-color: rgba(0, 229, 255, 0.62) !important;
    box-shadow:
        inset 0 0 28px rgba(0, 229, 255, 0.1),
        0 0 26px rgba(0, 229, 255, 0.24) !important;
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.78);
}

.sd-input-scan-wrap:focus-within .pass-toggle-btn {
    color: #6a8fa8;
    border-color: rgba(0, 229, 255, 0.38);
    box-shadow:
        0 0 10px rgba(0, 229, 255, 0.12),
        inset 0 0 10px rgba(0, 229, 255, 0.06);
}

/* Cursor terminal parpadeante cuando el campo está vacío y enfocado */
.sd-input-scan-wrap:focus-within .sd-input-secure:placeholder-shown {
    animation: sdInputCaretPulse 1.1s step-end infinite;
}

@keyframes sdInputCaretPulse {
    0%, 45% { caret-color: #00e5ff; }
    50%, 100% { caret-color: transparent; }
}

/* Fallback sin @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .sd-input-scan-wrap:focus-within::before {
        background: linear-gradient(90deg, #00e5ff, #2979ff, #d500f9, #00e5ff);
        background-size: 300% 100%;
        animation: sdBorderSlide 2s linear infinite;
    }
    @keyframes sdBorderSlide {
        to { background-position: 300% 0; }
    }
}

/* Botón autenticación */
.sd-btn-auth {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition:
        transform 0.34s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.34s ease,
        filter 0.34s ease,
        background 0.45s ease;
}

.sd-btn-auth-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.25em;
    width: 100%;
}

.sd-btn-auth-label,
.sd-btn-auth-state {
    transition:
        opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.sd-btn-auth-label {
    display: block;
    line-height: 1.25;
}

.sd-btn-auth-state {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    pointer-events: none;
    white-space: nowrap;
}

.sd-btn-auth-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    border-right-color: rgba(0, 229, 255, 0.85);
    border-radius: 50%;
    flex-shrink: 0;
    animation: sdAuthSpin 0.7s linear infinite;
}

.sd-btn-auth-status {
    font-size: clamp(10px, 2.6vw, 11px);
    letter-spacing: 0.1em;
    line-height: 1.2;
}

.sd-btn-auth-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 35%;
    opacity: 0;
    background: linear-gradient(90deg, transparent, #fff, #00e5ff, transparent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.75);
    pointer-events: none;
}

.sd-btn-auth::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-18deg);
    animation: sdBtnSheen 4s ease-in-out 1.8s infinite;
    transition: opacity 0.3s ease;
}

@keyframes sdBtnSheen {
    0%, 75% { left: -100%; }
    100% { left: 140%; }
}

@keyframes sdAuthSpin {
    to { transform: rotate(360deg); }
}

.sd-btn-auth.is-authenticating {
    transform: scale(0.985);
    pointer-events: none;
    filter: brightness(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 28px rgba(0, 229, 255, 0.35),
        0 0 48px rgba(41, 121, 255, 0.28) !important;
}

.sd-btn-auth.is-authenticating::after {
    opacity: 0;
    animation: none;
}

.sd-btn-auth.is-authenticating .sd-btn-auth-label {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
}

.sd-btn-auth.is-authenticating .sd-btn-auth-state {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sd-btn-auth.is-authenticating .sd-btn-auth-bar {
    opacity: 1;
    animation: sdAuthBarSweep 1.6s cubic-bezier(0.45, 0.05, 0.2, 1) infinite;
}

@keyframes sdAuthBarSweep {
    0% {
        left: -35%;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.sd-btn-auth.is-auth-success {
    transform: scale(1);
    pointer-events: none;
    filter: brightness(1.08);
    background: linear-gradient(180deg, #00e676 0%, #00a152 55%, #007a3d 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 32px rgba(0, 230, 118, 0.45) !important;
}

.sd-btn-auth.is-auth-success .sd-btn-auth-label {
    opacity: 0;
    transform: translateY(-8px);
}

.sd-btn-auth.is-auth-success .sd-btn-auth-state {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sd-btn-auth.is-auth-success .sd-btn-auth-spinner {
    animation: none;
    border-color: rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    transform: scale(1.05);
}

.sd-btn-auth.is-auth-success .sd-btn-auth-bar {
    opacity: 1;
    width: 100%;
    left: 0;
    animation: none;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

.sd-btn-auth.is-auth-error {
    animation: sdAuthShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes sdAuthShake {
    0%, 100% { transform: translateX(0) scale(0.985); }
    20% { transform: translateX(-4px) scale(0.985); }
    40% { transform: translateX(4px) scale(0.985); }
    60% { transform: translateX(-3px) scale(0.985); }
    80% { transform: translateX(2px) scale(0.985); }
}

.sd-link-recover {
    color: #6a7b92 !important;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.04em;
    transition: color 0.25s, text-shadow 0.25s;
}

.sd-link-recover:hover {
    color: #00e5ff !important;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

@media (max-width: 768px) {
    .sd-login-page {
        overflow-x: hidden;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }

    .sd-login-page .login-container {
        width: 100%;
        max-width: min(100%, 420px);
        margin: auto;
        flex-shrink: 0;
        padding: 34px 18px 26px !important;
    }

    .sd-scan-status {
        font-size: 12px;
        min-height: 48px;
        margin-bottom: 14px;
        line-height: 1.45;
        word-break: break-word;
    }

    .sd-scan-status-line {
        white-space: normal;
    }

    h2.sd-login-title {
        font-size: clamp(23px, 6vw, 26px);
    }

    .sd-login-sub {
        margin-bottom: 17px;
        font-size: 11px;
        letter-spacing: 0.16em;
    }

    .sd-label-secure {
        font-size: 11px !important;
        letter-spacing: 0.1em !important;
    }

    .sd-input-scan-wrap.has-toggle .sd-pass-decipher {
        padding-right: var(--sd-toggle-pad, 132px);
        font-size: 17px;
        letter-spacing: 0.06em;
    }

    .sd-input-scan-wrap .sd-input-secure {
        min-height: 53px;
        font-size: 17px !important;
    }

    .sd-input-scan-wrap.has-toggle .sd-input-secure.sd-input-pass {
        min-height: 53px;
        letter-spacing: 0.06em !important;
    }

    /* Ocultar contraseña — móvil: sin salto vertical */
    .sd-pass-decipher.sd-pass-fade-text {
        padding-top: 12px;
        padding-bottom: 12px;
        padding-left: 14px;
        line-height: 1.2;
    }

    .sd-pass-decipher.is-fading-out {
        animation: sdPassFadeOutMobile 0.44s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes sdPassFadeOutMobile {
        0% {
            opacity: 1;
            filter: blur(0);
        }
        100% {
            opacity: 0;
            filter: blur(3px);
        }
    }

    .sd-btn-auth {
        min-height: 60px;
        padding: 14px 10px !important;
    }

    .sd-btn-auth-label {
        font-size: clamp(13px, 3.6vw, 15px) !important;
        letter-spacing: 0.07em !important;
    }

    .sd-btn-auth-state {
        gap: 8px;
        padding: 0 6px;
    }

    .sd-btn-auth-status {
        font-size: clamp(12px, 3.2vw, 13px) !important;
        letter-spacing: 0.07em !important;
        white-space: normal;
        text-align: center;
        line-height: 1.15;
        max-width: calc(100% - 28px);
    }

    .sd-btn-auth-spinner {
        width: 15px;
        height: 15px;
    }

    .sd-btn-auth.is-authenticating,
    .sd-btn-auth.is-auth-success {
        transform: scale(0.992);
        -webkit-transform: scale(0.992);
    }

    .sd-btn-auth.is-auth-error {
        animation: sdAuthShakeMobile 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    }

    @keyframes sdAuthShakeMobile {
        0%, 100% { transform: translateX(0) scale(0.992); }
        20% { transform: translateX(-3px) scale(0.992); }
        40% { transform: translateX(3px) scale(0.992); }
        60% { transform: translateX(-2px) scale(0.992); }
        80% { transform: translateX(2px) scale(0.992); }
    }

    .sd-corner {
        width: 14px;
        height: 14px;
    }

    .sd-corner-tl,
    .sd-corner-tr {
        top: 10px;
    }
    .sd-corner-tl,
    .sd-corner-bl {
        left: 10px;
    }
    .sd-corner-tr,
    .sd-corner-br {
        right: 10px;
    }
    .sd-corner-bl,
    .sd-corner-br {
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .sd-input-scan-wrap.has-toggle .sd-pass-decipher {
        padding-right: var(--sd-toggle-pad, 132px);
        font-size: 17px;
    }

    .sd-login-page .login-container {
        padding: 26px 14px 22px !important;
    }

    .sd-scan-status {
        font-size: 11px;
        min-height: 41px;
        margin-bottom: 12px;
    }

    .sd-login-sub {
        margin-bottom: 14px;
        font-size: 10px;
        letter-spacing: 0.12em;
    }

    .sd-label-secure {
        font-size: 10px !important;
    }

    h2.sd-login-title {
        font-size: clamp(20px, 6.2vw, 24px);
    }

    .sd-input-scan-wrap .sd-input-secure,
    .sd-input-scan-wrap.has-toggle .sd-input-secure.sd-input-pass {
        min-height: 53px;
        font-size: 17px !important;
    }

    .sd-btn-auth {
        min-height: 58px !important;
    }

    .sd-btn-auth-label {
        font-size: clamp(12px, 3.8vw, 14px) !important;
        letter-spacing: 0.06em !important;
    }

    .sd-btn-auth-status {
        font-size: clamp(11px, 3.3vw, 12px) !important;
        letter-spacing: 0.06em !important;
    }

    .sd-btn-auth::after {
        width: 40%;
    }
}

@media (max-width: 360px) {
    .sd-btn-auth-label {
        font-size: 10px !important;
        letter-spacing: 0.05em !important;
    }

    .sd-btn-auth-status {
        font-size: 9px !important;
        letter-spacing: 0.05em !important;
    }

    .sd-btn-auth {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* —— Auth secundario (recuperar / restablecer): tema login, entrada más ligera —— */
body.sd-auth-lite .sd-scan-laser,
body.sd-auth-lite .sd-scan-laser-trail,
body.sd-auth-lite .sd-scan-flash,
body.sd-auth-lite .sd-scan-lines {
    display: none !important;
}

body.sd-auth-lite .sd-scan-grid {
    animation: none;
    opacity: 0.32;
}

body.sd-auth-lite .sd-vault-card {
    opacity: 0;
    transform: translateY(10px);
    filter: none;
    animation: sdAuthLiteReveal 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}

@keyframes sdAuthLiteReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.sd-auth-lite .sd-vault-card::before {
    animation: none;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.45);
}

body.sd-auth-lite .sd-corner {
    animation-duration: 0.32s;
}

body.sd-auth-lite .sd-corner-tl { animation-delay: 0.18s; }
body.sd-auth-lite .sd-corner-tr { animation-delay: 0.22s; }
body.sd-auth-lite .sd-corner-bl { animation-delay: 0.26s; }
body.sd-auth-lite .sd-corner-br { animation-delay: 0.3s; }

body.sd-auth-lite .sd-scan-status {
    min-height: 48px;
    margin-bottom: 18px;
}

body.sd-auth-lite .sd-scan-status-line:nth-child(1) { animation-delay: 0.14s; }
body.sd-auth-lite .sd-scan-status-line:nth-child(2) { animation-delay: 0.24s; }
body.sd-auth-lite .sd-scan-status-line:nth-child(3) { animation-delay: 0.34s; }

body.sd-auth-lite .sd-login-title {
    animation: sdTitleGlow 0.38s ease-out 0.38s 1 forwards;
}

body.sd-auth-lite .sd-login-title::after {
    animation-delay: 0.55s;
}

body.sd-auth-lite .sd-login-sub {
    animation-delay: 0.42s;
    margin-bottom: 22px;
}

body.sd-auth-lite .sd-help-auth {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(139, 158, 176, 0.82);
    text-align: left;
    opacity: 0;
    animation: sdStatusLine 0.35s ease-out 0.48s forwards;
}

body.sd-auth-lite .sd-msg-error,
body.sd-auth-lite .sd-msg-info {
    opacity: 0;
    animation: sdStatusLine 0.35s ease-out 0.52s forwards;
}

body.sd-auth-lite .sd-msg-error {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 23, 68, 0.45);
    border-radius: 8px;
    color: #ff6b81;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

body.sd-auth-lite .sd-msg-info {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 8px;
    color: rgba(139, 158, 176, 0.95);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

@media (prefers-reduced-motion: reduce) {
    body.sd-auth-lite .sd-vault-card,
    body.sd-auth-lite .sd-corner,
    body.sd-auth-lite .sd-scan-status-line,
    body.sd-auth-lite .sd-login-title,
    body.sd-auth-lite .sd-login-sub,
    body.sd-auth-lite .sd-help-auth,
    body.sd-auth-lite .sd-msg-error,
    body.sd-auth-lite .sd-msg-info {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
