/* ============================================
   Portal do Cliente Trigénius
   Recuperar Password - Estados e Animações
   ============================================ */

/* ============================================
   Estados do Card (transições)
   ============================================ */

.recovery-state {
    display: none;
    opacity: 0;
}

.recovery-state--active {
    display: block;
    opacity: 1;
    animation: recoveryFadeIn 0.35s var(--tg-ease) both;
}

.recovery-state--exit {
    display: block;
    animation: recoveryFadeOut 0.3s var(--tg-ease) both;
}

.recovery-state--enter {
    animation: recoveryFadeIn 0.35s var(--tg-ease) both;
}

@keyframes recoveryFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   Conteúdo do Resultado (Sucesso / Erro)
   ============================================ */

.recovery-result-content {
    text-align: center;
    padding: 0.5rem 0;
}

.recovery-result-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tg-gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.recovery-result-text {
    font-size: 0.88rem;
    color: var(--tg-gray-600);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.recovery-result-text strong {
    color: var(--tg-gray-900);
    font-weight: 600;
}

/* ============================================
   Ícones Animados - Container
   ============================================ */

.recovery-icon {
    width: 80px;
    height: 80px;
    margin: 0.25rem auto 1.25rem;
    position: relative;
}

/* ============================================
   Ícone Sucesso - Envelope com Check
   ============================================ */

.recovery-icon--success {
    color: var(--tg-green, #43a047);
}

.recovery-envelope-svg {
    width: 80px;
    height: 80px;
    color: var(--tg-green, #43a047);
}

.recovery-envelope-body {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: recoveryDrawLine 0.6s var(--tg-ease) 0.1s forwards;
}

.recovery-envelope-flap {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: recoveryDrawLine 0.5s var(--tg-ease) 0.4s forwards;
}

.recovery-check-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 30px;
    height: 30px;
    color: var(--tg-green, #43a047);
    animation: recoveryBadgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

.recovery-check-svg {
    width: 30px;
    height: 30px;
}

.recovery-check-path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: recoveryDrawLine 0.35s var(--tg-ease) 1.0s forwards;
}

@keyframes recoveryDrawLine {
    to {
        stroke-dashoffset: 0;
    }
}

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

/* ============================================
   Ícone Erro - Alertas SVG
   ============================================ */

.recovery-icon--error {
    color: var(--tg-red, #e53935);
}

.recovery-alert-svg {
    width: 80px;
    height: 80px;
    color: var(--tg-red, #e53935);
}

.recovery-alert-circle,
.recovery-alert-rect,
.recovery-alert-triangle {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: recoveryDrawLine 0.7s var(--tg-ease) 0.1s forwards;
}

.recovery-alert-line {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: recoveryDrawLine 0.3s var(--tg-ease) 0.5s forwards;
}

.recovery-alert-dot {
    opacity: 0;
    animation: recoveryDotAppear 0.2s var(--tg-ease) 0.75s forwards;
}

.recovery-alert-x1,
.recovery-alert-x2 {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: recoveryDrawLine 0.3s var(--tg-ease) 0.5s forwards;
}

@keyframes recoveryDotAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Dica (caixa de spam)
   ============================================ */

.recovery-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(var(--tg-blue-rgb), 0.04);
    border: 1px solid rgba(var(--tg-blue-rgb), 0.12);
    border-radius: var(--tg-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.recovery-hint i {
    color: var(--tg-blue);
    font-size: 0.85rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.recovery-hint span {
    font-size: 0.8rem;
    color: var(--tg-gray-600);
    line-height: 1.5;
}

.recovery-hint strong {
    color: var(--tg-gray-800);
    font-weight: 600;
}

/* ============================================
   Botões de Resultado
   ============================================ */

.recovery-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: var(--tg-radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s var(--tg-ease);
}

.recovery-btn--primary {
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-blue-dark));
    color: var(--tg-white) !important;
    box-shadow: 0 4px 15px rgba(var(--tg-blue-rgb), 0.3);
    margin-bottom: 0.65rem;
}

.recovery-btn--primary:hover {
    background: linear-gradient(135deg, var(--tg-blue-dark), var(--tg-blue-darker));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--tg-blue-rgb), 0.4);
    color: var(--tg-white) !important;
}

.recovery-btn--primary i {
    color: var(--tg-white) !important;
}

.recovery-btn--secondary {
    background: transparent;
    color: var(--tg-gray-600) !important;
    border: 1.5px solid var(--tg-gray-200);
    font-weight: 500;
    font-size: 0.84rem;
}

.recovery-btn--secondary:hover {
    border-color: var(--tg-gray-300);
    color: var(--tg-gray-800) !important;
    background: var(--tg-gray-50, #f8f9fa);
}

.recovery-btn--secondary i {
    color: inherit !important;
    font-size: 0.78rem;
}

.recovery-btn--secondary-link {
    background: transparent;
    color: var(--tg-gray-500) !important;
    font-weight: 400;
    font-size: 0.84rem;
    margin-top: 0.25rem;
}

.recovery-btn--secondary-link:hover {
    color: var(--tg-blue) !important;
}

.recovery-btn--secondary-link i {
    color: inherit !important;
    font-size: 0.75rem;
}

/* Cooldown state */
.recovery-btn--cooldown {
    opacity: 0.55;
    cursor: not-allowed;
}

.recovery-btn--cooldown:hover {
    transform: none;
    border-color: var(--tg-gray-200);
    color: var(--tg-gray-600) !important;
    background: transparent;
}

/* ============================================
   Spinner (Loading no botão)
   ============================================ */

.recovery-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--tg-white);
    border-radius: 50%;
    animation: recoverySpin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

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

/* Estado loading do botão - override DevExtreme */
.recovery-btn-loading.dx-button.dx-button-default {
    opacity: 0.85;
}

.recovery-btn-loading .dx-button-content {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Erro de Validação do Campo
   ============================================ */

.recovery-field-error {
    color: var(--tg-red, #e53935) !important;
    font-size: 0.78rem;
    margin-top: 0.4rem;
    margin-bottom: 0.25rem;
    padding-left: 2px;
}

/* ============================================
   Responsive - Mobile
   ============================================ */

@media (max-width: 480px) {
    .recovery-icon {
        width: 65px;
        height: 65px;
        margin-bottom: 1rem;
    }

    .recovery-envelope-svg,
    .recovery-alert-svg {
        width: 65px;
        height: 65px;
    }

    .recovery-check-badge {
        width: 25px;
        height: 25px;
    }

    .recovery-check-svg {
        width: 25px;
        height: 25px;
    }

    .recovery-result-title {
        font-size: 1.1rem;
    }

    .recovery-result-text {
        font-size: 0.82rem;
    }

    .recovery-hint {
        padding: 0.6rem 0.8rem;
    }

    .recovery-hint span {
        font-size: 0.75rem;
    }

    .recovery-btn {
        padding: 0.75rem;
        font-size: 0.84rem;
    }
}

@media (max-width: 480px) and (max-height: 740px) {
    .recovery-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 0.75rem;
    }

    .recovery-envelope-svg,
    .recovery-alert-svg {
        width: 55px;
        height: 55px;
    }

    .recovery-check-badge {
        width: 22px;
        height: 22px;
        bottom: -2px;
        right: -2px;
    }

    .recovery-check-svg {
        width: 22px;
        height: 22px;
    }

    .recovery-result-content {
        padding: 0;
    }

    .recovery-hint {
        margin-bottom: 1rem;
    }
}

/* ============================================
   Acessibilidade - Reduzir movimento
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .recovery-state--active,
    .recovery-state--exit,
    .recovery-state--enter,
    .recovery-envelope-body,
    .recovery-envelope-flap,
    .recovery-check-badge,
    .recovery-check-path,
    .recovery-alert-circle,
    .recovery-alert-rect,
    .recovery-alert-triangle,
    .recovery-alert-line,
    .recovery-alert-dot,
    .recovery-alert-x1,
    .recovery-alert-x2,
    .recovery-spinner {
        animation: none !important;
    }

    .recovery-state--active {
        opacity: 1;
    }

    .recovery-envelope-body,
    .recovery-envelope-flap,
    .recovery-check-path,
    .recovery-alert-circle,
    .recovery-alert-rect,
    .recovery-alert-triangle,
    .recovery-alert-line,
    .recovery-alert-x1,
    .recovery-alert-x2 {
        stroke-dashoffset: 0 !important;
    }

    .recovery-check-badge,
    .recovery-alert-dot {
        opacity: 1 !important;
        transform: scale(1) !important;
    }

    .recovery-btn,
    .recovery-btn--primary,
    .recovery-btn--secondary,
    .recovery-btn--secondary-link {
        transition: none !important;
    }

    .recovery-btn--primary:hover {
        transform: none !important;
    }
}
