.clave-unica-auth-btn {
    background-color: #FF0051;
    color: #fff;
    border: 1px solid #FF0051;
    border-radius: 25px;
    transition: all .4s ease-in-out;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    display: none;
    box-shadow: 0 2px 6px rgba(255, 0, 81, 0.15);
}

/* Point 8: Hover scale sutil + sombra reforzada */
.clave-unica-auth-btn:hover:not(:disabled) {
    background-color: #fff;
    color: #FF0051;
    border: 1px solid #FF0051;
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(255, 0, 81, 0.25);
}

.clave-unica-auth-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.clave-unica-auth-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Point 2: Spinner animado en bot\u00f3n "Autenticando..." */
.clave-unica-auth-btn.loading {
    background-color: #FF0051;
    color: #fff;
    border: 1px solid #FF0051;
    position: relative;
    padding-left: 42px;
}

.clave-unica-auth-btn.loading::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cu-spin 0.7s linear infinite;
}

@keyframes cu-spin {
    to {
        transform: rotate(360deg);
    }
}

.clave-unica-auth-btn.authenticated {
    background-color: #FF0051;
    color: #fff;
    border: 1px solid #FF0051;
}

.reload-page-btn {
    background-color: #FF0051;
    color: #fff;
    border: 1px solid #FF0051;
    border-radius: 25px;
    transition: all .4s ease-in-out;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
}

.reload-page-btn:hover {
    background-color: #fff;
    color: #FF0051;
    border: 1px solid #FF0051;
}

.wpcf7-form.sent .wpcf7-submit {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Centrado del bot\u00f3n submit + spinner default de CF7 */
.wpcf7-form p:has(> .wpcf7-submit),
.wpcf7-form .submit-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* Fallback: m\u00e1s margen arriba del submit en cualquier estructura */
.wpcf7-form .wpcf7-submit {
    margin-top: 32px;
    vertical-align: middle;
}

/* Alinear el spinner default de CF7 con el bot\u00f3n */
.wpcf7-form .wpcf7-spinner {
    vertical-align: middle;
    margin-top: 32px !important;
    margin-left: 12px !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

/* Estado submitting: bot\u00f3n atenuado */
.wpcf7-form.submitting .wpcf7-submit {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.clave-unica-protected-form {
    transition: opacity 0.3s ease;
}

/* Add this to ensure the button stays hidden */
.wpcf7-form.sent #clave-unica-btn-container,
.wpcf7-form.sent #clave-unica-btn {
    display: none !important;
}

/* Add styles for countdown and reset button */
.form-success-message {
    margin: 20px 0;
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 4px;
}

.countdown-reset {
    margin: 10px 0;
    color: #6c757d;
}

.reset-now-btn {
    background-color: #FF0051;
    color: #fff;
    border: 1px solid #FF0051;
    border-radius: 25px;
    transition: all .4s ease-in-out;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
}

.reset-now-btn:hover {
    background-color: #fff;
    color: #FF0051;
    border: 1px solid #FF0051;
}

/* Add this to ensure the button stays hidden */
.authenticated-state #clave-unica-btn-container,
.authenticated-state #clave-unica-btn {
    display: none !important;
}

#countdown {
position: relative;
margin: auto;
margin-top: 100px;
height: 40px;
width: 40px;
text-align: center;
}

#countdown-number {
color: white;
display: inline-block;
line-height: 40px;
}

.countdown-svg {
position: absolute;
top: 0;
right: 0;
width: 40px;
height: 40px;
transform: rotateY(-180deg) rotateZ(-90deg);
}

.countdown-svg circle {
stroke-dasharray: 113px;
stroke-dashoffset: 0px;
stroke-linecap: round;
stroke-width: 2px;
stroke: white;
fill: none;
animation: countdown 10s linear infinite forwards;
}

@keyframes countdown {
from {
    stroke-dashoffset: 0px;
}
to {
    stroke-dashoffset: 113px;
}
}

/* Point 4: Countdown container con estilo mejorado */
.countdown-container {
    display: none;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 24px;
    padding: 10px 16px;
    font-size: 14px;
    color: #555;
    background-color: rgba(255, 0, 81, 0.04);
    border-radius: 20px;
    border: 1px solid rgba(255, 0, 81, 0.1);
    width: fit-content;
}

.countdown-container.visible {
    display: flex;
    justify-content: start;
    animation: fadeInDown 0.4s ease-out;
}

.countdown-message {
    margin-right: 12px;
    font-weight: 500;
}

.countdown-timer {
    position: relative;
    height: 30px;
    width: 30px;
    text-align: center;
    animation: countdownPulse 2s ease-in-out infinite;
}

.countdown-number {
    color: #FF0051;
    display: inline-block;
    line-height: 30px;
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

.countdown-svg {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    transform: rotateY(-180deg) rotateZ(-90deg);
}

.countdown-svg circle {
    stroke-dasharray: 85px;
    stroke-dashoffset: 0px;
    stroke-linecap: round;
    stroke-width: 2px;
    stroke: #FF0051;
    fill: none;
}

@keyframes countdown {
    from {
        stroke-dashoffset: 0px;
    }
    to {
        stroke-dashoffset: 85px;
    }
}

.expiration-message {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* Point 6: Readonly fields (datos de Clave \u00danica) con candado + gradiente */
.clave-unica-protected-form .wpcf7-form-control-wrap,
.wpcf7 .wpcf7-form-control-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.clave-unica-protected-form input[readonly],
.wpcf7 input[readonly] {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%) !important;
    color: #495057;
    cursor: default;
    padding-right: 36px !important;
    border: 1px solid #e0e3e7 !important;
}

.clave-unica-protected-form .wpcf7-form-control-wrap:has(input[readonly])::after,
.wpcf7 .wpcf7-form-control-wrap:has(input[readonly])::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF0051' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0.7;
}

#clave-unica-btn {
    display: none;
}

/* Point 5: Custom error tip con fade-in + icono + borde izquierdo */
.custom-error-tip,
.wpcf7-not-valid-tip:not(.dynamic-selectors .wpcf7-not-valid-tip) {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px 8px 32px;
    color: #dc3232;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    clear: both;
    background-color: rgba(220, 50, 50, 0.06);
    border-left: 3px solid #dc3232;
    border-radius: 4px;
    position: relative;
    animation: fadeInLeft 0.3s ease-out;
}

.custom-error-tip::before,
.wpcf7-not-valid-tip:not(.dynamic-selectors .wpcf7-not-valid-tip)::before {
    content: '\26A0';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    line-height: 1;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* CF7 error response (validation errors, mail failed, etc.).
 * Usamos las clases persistentes del output para que el estilo sobreviva
 * al reset autom\u00e1tico del form (.sent/.invalid -> .init).
 */
.wpcf7 .wpcf7-response-output.wpcf7-validation-errors,
.wpcf7 .wpcf7-response-output.wpcf7-acceptance-missing,
.wpcf7 .wpcf7-response-output.wpcf7-spam-blocked,
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ng,
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3232;
    background: linear-gradient(135deg, #fbe7e7 0%, #faf0f0 100%);
    color: #721c24;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 500;
    animation: fadeInDown 0.3s ease-out;
}

/* Mensaje de \u00e9xito inline de CF7: lo ocultamos porque usamos el banner flotante
 * (.clave-unica-persistent-success). CF7 lo borra autom\u00e1ticamente a los ~3s,
 * generando efecto "parpadeo".
 */
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok,
.wpcf7 form.sent .wpcf7-response-output {
    display: none !important;
}

/* Punto 3 hist\u00f3rico: estilo para .cf7-success-message (clase legacy custom, por si se usa inline) */
.cf7-success-message {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5ea 100%);
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 18px 22px 18px 56px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 12px rgba(40, 167, 69, 0.12);
    animation: fadeInDown 0.4s ease-out, successGlow 2s ease-in-out;
}

/* Banner persistente inline dentro del form-wrapper (fuera del <form> CF7) */
.clave-unica-persistent-success {
    position: relative;
    background: linear-gradient(135deg, #d4edda 0%, #e8f5ea 100%);
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 18px 22px 18px 56px;
    border-radius: 10px;
    margin: 20px 0 0 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 2px 12px rgba(40, 167, 69, 0.12);
    animation: fadeInDown 0.4s ease-out, successGlow 2s ease-in-out;
}

.cf7-success-message::before,
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok::before,
.wpcf7 form.sent .wpcf7-response-output::before,
.clave-unica-persistent-success::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    background-color: #28a745;
    border-radius: 50%;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    animation: checkmarkPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.1s backwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes successGlow {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(40, 167, 69, 0.12);
    }
    50% {
        box-shadow: 0 2px 20px rgba(40, 167, 69, 0.35);
    }
}