.recovery-modal-overlay {
    --recovery-green: #134E39;
    --recovery-green-hover: #0F4230;
    --recovery-surface: #f6f8f7;
    --recovery-border: #dfe7e3;
    --recovery-text: #0f1f17;
    --recovery-muted: #4b5b53;
    --recovery-soft-green: #eaf4ef;
    --recovery-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 31, 23, 0.5);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms var(--recovery-ease-out), visibility 0s linear 220ms;
}

.recovery-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 240ms var(--recovery-ease-out), visibility 0s linear 0s;
}

.recovery-modal-overlay.is-closing {
    opacity: 0;
    visibility: visible;
    pointer-events: none;
    transition: opacity 160ms var(--recovery-ease-out), visibility 0s linear 160ms;
}

.recovery-modal {
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    position: relative;
    padding: 28px;
    color: var(--recovery-text);
    background: #fff;
    border: 1px solid var(--recovery-border);
    border-radius: 18px;
    box-shadow: 0 24px 65px rgba(15, 31, 23, 0.24), 0 5px 16px rgba(15, 31, 23, 0.08);
    opacity: 0;
    transform: scale(0.96);
    transform-origin: center;
    transition: opacity 240ms var(--recovery-ease-out), transform 240ms var(--recovery-ease-out);
    scrollbar-color: #b7ccc0 var(--recovery-surface);
    scrollbar-width: thin;
}

.recovery-modal-overlay.active .recovery-modal {
    opacity: 1;
    transform: scale(1);
}

.recovery-modal-overlay.is-closing .recovery-modal {
    opacity: 0;
    transform: scale(0.985);
    transition-duration: 160ms;
}

.recovery-modal::-webkit-scrollbar {
    width: 8px;
}

.recovery-modal::-webkit-scrollbar-track {
    background: var(--recovery-surface);
    border-radius: 8px;
}

.recovery-modal::-webkit-scrollbar-thumb {
    background: #b7ccc0;
    border: 2px solid var(--recovery-surface);
    border-radius: 8px;
}

.recovery-modal [hidden] {
    display: none !important;
}

.recovery-modal-header {
    padding-right: 48px;
    margin-bottom: 24px;
}

.recovery-modal-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 16px;
    color: var(--recovery-green);
    font-size: 1.05rem;
    background: var(--recovery-soft-green);
    border: 1px solid #d2e8dc;
    border-radius: 13px;
}

.recovery-modal h4 {
    margin: 0;
    color: var(--recovery-text);
    font-size: clamp(1.25rem, 2.8vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.recovery-subtitle {
    max-width: 42ch;
    margin: 8px 0 0;
    color: var(--recovery-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.recovery-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--recovery-muted);
    background: var(--recovery-surface);
    border: 1px solid var(--recovery-border);
    border-radius: 12px;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.recovery-modal-close:hover {
    color: var(--recovery-green);
    background: var(--recovery-soft-green);
    border-color: #c5ddd0;
}

.recovery-modal-close:active,
.recovery-primary-action:active,
.recovery-channel:active,
.recovery-text-action:active,
.recovery-password-toggle:active {
    transform: scale(0.97);
}

.recovery-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    margin: 0 0 26px;
    list-style: none;
}

.recovery-progress::before {
    position: absolute;
    top: 17px;
    right: 16.67%;
    left: 16.67%;
    height: 1px;
    content: '';
    background: var(--recovery-border);
}

.recovery-progress::after {
    position: absolute;
    top: 17px;
    left: 16.67%;
    width: 0;
    height: 1px;
    content: '';
    background: var(--recovery-green);
    transition: width 230ms var(--recovery-ease-out);
}

.recovery-progress[data-active-step="2"]::after {
    width: 33.33%;
}

.recovery-progress[data-active-step="3"]::after,
.recovery-progress[data-active-step="success"]::after,
.recovery-progress.is-complete::after {
    width: 66.66%;
}

.recovery-progress-step {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #718078;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    transition: color 180ms ease;
}

.recovery-progress-marker {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    color: #718078;
    font-size: 0.75rem;
    background: #fff;
    border: 1px solid #cbdad2;
    border-radius: 50%;
    transition: color 200ms var(--recovery-ease-out), background-color 200ms var(--recovery-ease-out), border-color 200ms var(--recovery-ease-out), box-shadow 200ms var(--recovery-ease-out);
}

.recovery-progress-step.is-active {
    color: var(--recovery-green);
}

.recovery-progress-step.is-active .recovery-progress-marker {
    color: #fff;
    background: var(--recovery-green);
    border-color: var(--recovery-green);
    box-shadow: 0 5px 12px rgba(19, 78, 57, 0.2);
}

.recovery-progress-step.is-complete .recovery-progress-marker {
    color: var(--recovery-green);
    background: var(--recovery-soft-green);
    border-color: #b8d8c5;
}

.recovery-progress-step.is-complete.is-active .recovery-progress-marker {
    color: #fff;
    background: var(--recovery-green);
    border-color: var(--recovery-green);
}

.recovery-progress-check {
    display: none;
}

.recovery-progress-step.is-complete .recovery-progress-number {
    display: none;
}

.recovery-progress-step.is-complete .recovery-progress-check {
    display: inline-block;
}

.recovery-step-stack {
    display: grid;
    min-width: 0;
}

.recovery-step {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-self: start;
    gap: 0;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
    transition: opacity 230ms var(--recovery-ease-out), transform 230ms var(--recovery-ease-out), filter 230ms var(--recovery-ease-out), visibility 0s linear 230ms;
}

.recovery-step.is-active {
    position: relative;
    top: auto;
    left: auto;
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition: opacity 230ms var(--recovery-ease-out), transform 230ms var(--recovery-ease-out), filter 230ms var(--recovery-ease-out), visibility 0s linear 0s;
}

.recovery-field {
    display: grid;
    gap: 8px;
    margin-bottom: 17px;
}

.recovery-field-label {
    color: var(--recovery-text);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.recovery-field-hint {
    margin: 0;
    color: var(--recovery-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.recovery-input-shell {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 12px;
    transition: box-shadow 160ms ease;
}

.recovery-input-shell:focus-within {
    box-shadow: 0 0 0 3px rgba(19, 78, 57, 0.15);
}

.recovery-input-shell > input {
    width: 100%;
    min-height: 50px;
    padding: 12px 48px 12px 45px;
    color: var(--recovery-text);
    font: inherit;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid #cbdad2;
    border-radius: 12px;
    outline: none;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.recovery-input-shell > input::placeholder {
    color: #77867e;
    opacity: 1;
}

.recovery-input-shell > input:focus {
    border-color: var(--recovery-green);
    background: #fff;
}

.recovery-input-icon {
    position: absolute;
    left: 16px;
    z-index: 1;
    color: #779186;
    font-size: 0.9rem;
    pointer-events: none;
}

.recovery-password-toggle {
    position: absolute;
    right: 3px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--recovery-muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.recovery-password-toggle:hover {
    color: var(--recovery-green);
    background: var(--recovery-soft-green);
}

.recovery-primary-action {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    padding: 12px 18px;
    color: #fff;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--recovery-green);
    border: 1px solid var(--recovery-green);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(19, 78, 57, 0.16);
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.recovery-primary-action:hover {
    background: var(--recovery-green-hover);
    border-color: var(--recovery-green-hover);
    box-shadow: 0 10px 22px rgba(0, 84, 58, 0.2);
}

.recovery-primary-action:disabled,
.recovery-channel:disabled,
.recovery-text-action:disabled {
    cursor: not-allowed;
}

.recovery-primary-action:disabled {
    opacity: 0.82;
}

.recovery-button-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.recovery-primary-action.is-loading .recovery-button-label {
    display: none;
}

.recovery-primary-action.is-loading .recovery-button-loading {
    display: inline-flex;
}

.recovery-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: recovery-spin 720ms linear infinite;
}

.recovery-step-intro {
    margin-bottom: 17px;
}

.recovery-helper {
    margin: 0 0 5px;
    color: var(--recovery-text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
}

.recovery-channel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 13px;
}

.recovery-channel {
    display: grid;
    min-width: 0;
    min-height: 98px;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 11px;
    padding: 14px;
    color: var(--recovery-text);
    text-align: left;
    background: var(--recovery-surface);
    border: 1px solid var(--recovery-border);
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.recovery-channel:hover:not(:disabled) {
    background: #f0f7f3;
    border-color: #a8cbb8;
    box-shadow: 0 8px 18px rgba(15, 31, 23, 0.07);
}

.recovery-channel:disabled {
    opacity: 0.78;
}

.recovery-channel.is-loading {
    border-color: #9ec7b0;
    background: #f0f7f3;
}

.recovery-channel.is-selected {
    border-color: var(--recovery-green);
    box-shadow: 0 0 0 3px rgba(19, 78, 57, 0.12);
}

.recovery-channel-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--recovery-green);
    font-size: 1rem;
    background: #fff;
    border: 1px solid #d5e5dc;
    border-radius: 12px;
}

.recovery-channel-icon-telegram {
    color: #167db7;
}

.recovery-channel-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.recovery-channel-copy strong {
    overflow: hidden;
    color: var(--recovery-text);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recovery-channel-mask {
    overflow: hidden;
    color: var(--recovery-muted);
    font-size: 0.7rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recovery-channel-action {
    display: grid;
    min-width: 20px;
    min-height: 20px;
    place-items: center;
    color: var(--recovery-green);
    font-size: 0.78rem;
}

.recovery-channel .recovery-spinner {
    display: none;
    width: 15px;
    height: 15px;
}

.recovery-channel.is-loading .recovery-channel-arrow {
    display: none;
}

.recovery-channel.is-loading .recovery-spinner {
    display: inline-block;
}

.recovery-text-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    color: var(--recovery-green);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.recovery-text-action:hover:not(:disabled) {
    background: var(--recovery-soft-green);
}

.recovery-text-action:disabled {
    color: #7d8983;
}

.recovery-code-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 18px;
    color: #245c42;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.45;
    background: var(--recovery-soft-green);
    border: 1px solid #cfe5d8;
    border-radius: 12px;
}

.recovery-code-notice > i {
    padding-top: 2px;
    color: var(--recovery-green);
}

.recovery-field-heading {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recovery-resend-link {
    min-height: 44px;
    flex: 0 0 auto;
    padding-right: 0;
    padding-left: 0;
    font-size: 0.72rem;
}

.recovery-otp-group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.recovery-otp-input {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 8px 2px;
    color: var(--recovery-text);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    background: #fff;
    border: 1px solid #cbdad2;
    border-radius: 12px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.recovery-otp-input:focus {
    border-color: var(--recovery-green);
    box-shadow: 0 0 0 3px rgba(19, 78, 57, 0.15);
    transform: translateY(-1px);
}

.recovery-otp-input.is-filled {
    background: #fbfdfc;
    border-color: #9ec7b0;
}

.recovery-password-strength {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.recovery-strength-track {
    display: grid;
    min-width: 0;
    flex: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.recovery-strength-segment {
    display: block;
    height: 5px;
    background: #e1ebe5;
    border-radius: 999px;
    transition: background-color 180ms ease;
}

.recovery-password-strength[data-strength="1"] .recovery-strength-segment.is-filled {
    background: #b94a4a;
}

.recovery-password-strength[data-strength="2"] .recovery-strength-segment.is-filled {
    background: #c38b32;
}

.recovery-password-strength[data-strength="3"] .recovery-strength-segment.is-filled {
    background: #5b9e73;
}

.recovery-password-strength[data-strength="4"] .recovery-strength-segment.is-filled {
    background: var(--recovery-green);
}

.recovery-strength-label {
    min-width: 92px;
    color: var(--recovery-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: right;
}

.recovery-password-checks {
    display: grid;
    gap: 7px;
    padding: 0;
    margin: -2px 0 17px;
    color: var(--recovery-muted);
    font-size: 0.72rem;
    list-style: none;
}

.recovery-password-checks li {
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 160ms ease;
}

.recovery-password-checks li > i {
    color: #9aa9a1;
    font-size: 0.68rem;
}

.recovery-password-checks li.is-valid {
    color: #246446;
}

.recovery-password-checks li.is-valid > i {
    color: var(--recovery-green);
}

.recovery-status {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    margin-top: 17px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.45;
    border-radius: 12px;
}

.recovery-status.is-visible {
    display: flex;
}

.recovery-status > i {
    padding-top: 2px;
    font-size: 0.85rem;
}

.recovery-status.is-info {
    color: #315d4a;
    background: #f1f7f3;
    border: 1px solid #d5e6db;
}

.recovery-status.is-info > i {
    color: #4d8064;
}

.recovery-status.is-error {
    color: #8a3434;
    background: #fff4f3;
    border: 1px solid #f0cfc9;
}

.recovery-status.is-error > i {
    color: #b94a4a;
}

.recovery-status.is-success {
    color: #246446;
    background: #eff8f2;
    border: 1px solid #cce5d4;
}

.recovery-status.is-success > i {
    color: var(--recovery-green);
}

.recovery-success-state {
    align-items: center;
    padding: 8px 0 2px;
    text-align: center;
}

.recovery-success-icon {
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    margin-bottom: 16px;
    color: #fff;
    font-size: 1.65rem;
    background: var(--recovery-green);
    border: 8px solid #e2f0e8;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(19, 78, 57, 0.16);
    animation: recovery-check-pop 420ms var(--recovery-ease-out) both;
}

.recovery-success-state h5 {
    margin: 0;
    color: var(--recovery-text);
    font-size: 1.14rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.recovery-success-state p {
    max-width: 39ch;
    margin: 8px 0 20px;
    color: var(--recovery-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.recovery-success-state .recovery-primary-action {
    max-width: 300px;
}

.recovery-modal :focus-visible {
    outline: 3px solid rgba(19, 78, 57, 0.32);
    outline-offset: 3px;
}

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

@keyframes recovery-check-pop {
    0% {
        opacity: 0;
        transform: scale(0.78);
    }
    70% {
        opacity: 1;
        transform: scale(1.04);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (hover: hover) and (pointer: fine) {
    .recovery-modal-close:hover,
    .recovery-password-toggle:hover,
    .recovery-text-action:hover:not(:disabled),
    .recovery-primary-action:hover,
    .recovery-channel:hover:not(:disabled) {
        cursor: pointer;
    }
}

@media (max-width: 480px) {
    .recovery-modal-overlay {
        padding: 10px;
    }

    .recovery-modal {
        max-height: calc(100vh - 20px);
        padding: 22px 18px 20px;
    }

    .recovery-modal-close {
        top: 14px;
        right: 14px;
    }

    .recovery-modal-header {
        padding-right: 42px;
        margin-bottom: 20px;
    }

    .recovery-modal-mark {
        width: 40px;
        height: 40px;
        margin-bottom: 13px;
    }

    .recovery-progress {
        gap: 4px;
        margin-bottom: 22px;
    }

    .recovery-progress-step {
        gap: 7px;
        font-size: 0.63rem;
    }

    .recovery-progress-marker {
        width: 31px;
        height: 31px;
        font-size: 0.68rem;
    }

    .recovery-progress::before,
    .recovery-progress::after {
        top: 15px;
    }

    .recovery-channel-grid {
        grid-template-columns: 1fr;
    }

    .recovery-otp-group {
        gap: 5px;
    }

    .recovery-otp-input {
        min-height: 49px;
        font-size: 1.05rem;
    }

    .recovery-strength-label {
        min-width: 84px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .recovery-modal-overlay,
    .recovery-modal,
    .recovery-step,
    .recovery-progress::after,
    .recovery-progress-marker,
    .recovery-progress-step,
    .recovery-spinner,
    .recovery-success-icon,
    .recovery-modal-close,
    .recovery-primary-action,
    .recovery-channel,
    .recovery-text-action,
    .recovery-password-toggle,
    .recovery-otp-input,
    .recovery-strength-segment,
    .recovery-password-checks li {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
    }

    .recovery-modal,
    .recovery-step,
    .recovery-step.is-active,
    .recovery-modal-overlay.active .recovery-modal,
    .recovery-modal-overlay.is-closing .recovery-modal {
        transform: none;
        filter: none;
    }

    .recovery-spinner {
        animation: none !important;
    }
}

/* Tipografia del mundo del login: Montserrat en titulo y botones */
.recovery-modal h4,
.recovery-primary-action,
.recovery-channel strong {
    font-family: 'Montserrat', system-ui, sans-serif;
}

.recovery-modal-header {
    padding-right: 48px;
}
