.codepty-contact {
    --codepty-form-body: var(--font-body, 1.2rem);
    --codepty-form-action: var(--font-action, 1.5rem);
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    padding: 18px;
    border: 1px solid #e3e8ef;
    border-radius: 20px;
    background: #fff;
    color: #17233c;
    box-shadow: 0 14px 40px rgba(23, 35, 60, 0.08);
    display: flex;
    flex-direction: column;
}

.codepty-contact *,
.codepty-contact *::before,
.codepty-contact *::after {
    box-sizing: border-box;
}

.codepty-contact [hidden] {
    display: none !important;
}

.codepty-contact__title {
    margin: 0 0 12px;
    color: #0057b8;
    font-size: var(--codepty-form-action);
    line-height: 1.3;
}

.codepty-contact__field {
    margin-bottom: 10px;
}

.codepty-contact__field label {
    display: block;
    margin-bottom: 7px;
    color: #263650;
    font-weight: 700;
}

.codepty-contact__field input,
.codepty-contact__field textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    border: 1px solid #d5dfec;
    border-radius: 14px;
    background: #fbfdff;
    color: #17233c;
    font: inherit;
    font-size: var(--codepty-form-body);
}

.codepty-contact__field textarea {
    min-height: 150px;
    resize: vertical;
}

.codepty-contact__form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.codepty-contact__field--message {
    min-height: 150px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.codepty-contact__field--message textarea {
    height: 100%;
    flex: 1;
}

.codepty-contact__field input:focus,
.codepty-contact__field textarea:focus {
    border-color: #1261a6;
    outline: 3px solid rgba(18, 97, 166, 0.16);
}

.codepty-contact__privacy {
    margin: 4px 0 14px;
    color: #5a6678;
    font-size: var(--codepty-form-body);
    line-height: 1.5;
}

.codepty-contact__verification {
    padding: 4px 2px;
}

.codepty-contact__verification-intro {
    margin: 0 0 3px;
    color: #384761;
    line-height: 1.5;
}

.codepty-contact__verification-email {
    display: block;
    overflow-wrap: anywhere;
    color: #17233c;
    font-size: 1.08em;
}

.codepty-contact__change-email,
.codepty-contact__resend {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1261a6;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.codepty-contact__change-email {
    margin-top: 5px;
}

.codepty-contact__change-email:hover,
.codepty-contact__change-email:focus-visible,
.codepty-contact__resend:hover,
.codepty-contact__resend:focus-visible {
    color: #083f72;
}

.codepty-contact__verification-status {
    min-height: 1.4em;
    margin: 10px 0;
    color: #516078;
    line-height: 1.4;
}

.codepty-contact__verification-status.is-error {
    padding: 10px 12px;
    border: 1px solid #efb0b0;
    border-radius: 10px;
    background: #fff1f1;
    color: #a02222;
}

.codepty-contact__verification-status.is-success {
    color: #23643a;
}

.codepty-contact__code-row {
    display: flex;
    justify-content: space-between;
    gap: clamp(8px, 3vw, 20px);
    margin-top: 18px;
}

.codepty-contact__code {
    width: min(22%, 72px);
    min-height: 58px;
    padding: 8px;
    border: 1px solid #1261a6;
    border-radius: 10px;
    background: #fff;
    color: #17233c;
    font: inherit;
    font-size: 1.45rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.codepty-contact__code.is-error {
    border-color: #e2252b;
    background: #fffafa;
}

.codepty-contact__code:focus {
    border-color: #1261a6;
    outline: 3px solid rgba(18, 97, 166, 0.16);
}

.codepty-contact__code-help {
    margin: 7px 0 0;
    color: #68758a;
    font-size: 0.9em;
}

.codepty-contact__resend-help {
    margin: 12px 0 0;
    color: #384761;
}

.codepty-contact__initial-status {
    min-height: 0;
    margin: 0;
    color: #a02222;
    line-height: 1.4;
    text-align: center;
}

.codepty-contact__initial-status:not(:empty) {
    min-height: 1.4em;
    margin-top: 10px;
}

.codepty-contact__success {
    padding: 26px 4px 4px;
    text-align: center;
}

.codepty-contact__success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #11bd5a;
    color: #fff;
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
}

.codepty-contact__success p {
    margin: 8px auto 28px;
    max-width: 34rem;
    color: #384761;
    line-height: 1.6;
}

.codepty-contact__submit {
    width: 100%;
    min-height: 54px;
    padding: 13px 20px;
    border: 0;
    border-radius: 12px;
    background: #d71920;
    color: #fff;
    font: inherit;
    font-size: var(--codepty-form-action);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(215, 25, 32, 0.24);
    margin-top: auto;
}

.codepty-contact__start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.codepty-contact__start-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
}

.codepty-contact__start.is-loading .codepty-contact__start-icon {
    display: none;
}

.codepty-contact__submit:hover,
.codepty-contact__submit:focus-visible {
    background: #b92027;
}

.codepty-contact__submit:disabled {
    cursor: wait;
    opacity: 1;
}

.codepty-contact__submit.is-loading::before {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: inline-block;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    content: '';
    vertical-align: -4px;
    animation: codepty-contact-spin 0.75s linear infinite;
}

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

.codepty-contact__notice {
    margin: 0 0 20px;
    padding: 14px 16px;
    border-radius: 12px;
}

.codepty-contact__notice p,
.codepty-contact__notice ul {
    margin-top: 0;
}

.codepty-contact__notice--success {
    border: 1px solid #5eb97c;
    background: #eefaf2;
    color: #225d35;
}

.codepty-contact__notice--error {
    border: 1px solid #df7777;
    background: #fff3f3;
    color: #7d2020;
}

.codepty-contact__trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.codepty-contact__sr-only {
    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;
}

.codepty-contact__alternatives {
    margin-top: 18px;
    padding-top: 16px;
    display: none;
    border-top: 1px solid #e3e8ef;
}

.codepty-contact.is-smartphone .codepty-contact__alternatives {
    display: block;
}

.codepty-contact__alternatives-intro {
    margin: 0 0 10px;
    color: #5a6678;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
}

.codepty-contact__alternatives-list {
    display: grid;
    gap: 9px;
}

.codepty-contact__alternative {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e1ec;
    border-radius: 12px;
    background: #f8fafc;
    color: #263650;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(23, 35, 60, 0.05);
}

.codepty-contact__alternative--whatsapp,
.codepty-contact__alternative--phone {
    gap: 9px;
    padding: 10px 14px;
}

.codepty-contact__alternative--combined {
    overflow: hidden;
}

.codepty-contact__alternative:hover {
    border-color: #b9c8d9;
    background: #f1f5f9;
    color: #17233c;
}

.codepty-contact__alternative:focus-within,
.codepty-contact__alternative--whatsapp:focus-visible,
.codepty-contact__alternative--phone:focus-visible {
    outline: 3px solid rgba(18, 97, 166, 0.2);
    outline-offset: 2px;
}

.codepty-contact__combined-phone,
.codepty-contact__combined-whatsapp {
    min-height: 48px;
    display: flex;
    align-items: center;
    color: #263650;
    text-decoration: none;
}

.codepty-contact__combined-phone {
    width: 54px;
    flex: 0 0 54px;
    justify-content: center;
    border-right: 1px solid #d8e1ec;
}

.codepty-contact__combined-whatsapp {
    min-width: 0;
    padding: 10px 14px;
    flex: 1;
    justify-content: center;
    gap: 9px;
}

.codepty-contact__combined-phone:hover,
.codepty-contact__combined-phone:focus-visible,
.codepty-contact__combined-whatsapp:hover,
.codepty-contact__combined-whatsapp:focus-visible {
    background: #eef3f8;
    color: #17233c;
    outline: 0;
}

.codepty-contact__alternative-icon {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
}

.codepty-contact__alternative-icon--phone {
    color: #1261a6;
}

.codepty-contact__alternative-icon--whatsapp {
    color: #25d366;
}

/* Evita una tarjeta anidada cuando el shortcode ocupa la tarjeta de la portada. */
.contact > .codepty-contact {
    max-width: none;
    min-height: 100%;
    padding: 4px;
    display: flex;
    flex: 1;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.contact > .codepty-contact .codepty-contact__title {
    margin-top: 2px;
}

.contact > .codepty-contact .codepty-contact__form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.contact > .codepty-contact .codepty-contact__field--message {
    min-height: 150px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.contact > .codepty-contact .codepty-contact__field textarea {
    min-height: 150px;
    flex: 1;
}

.contact > .codepty-contact .codepty-contact__submit {
    margin-top: auto;
}

@media (min-width: 768px) {
    .contact > .codepty-contact {
        padding: 0;
    }

    .contact > .codepty-contact .codepty-contact__initial,
    .package-hero-contact .codepty-contact__initial {
        min-height: 0;
        display: flex;
        flex: 1;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .codepty-contact {
        padding: 16px;
        border-radius: 16px;
    }

    .contact > .codepty-contact {
        padding: 4px;
    }

    .codepty-contact__code {
        min-height: 54px;
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .codepty-contact__submit.is-loading::before {
        animation-duration: 1.5s;
    }
}
