/* ===== MATA AI - FORM SUCCESS MESSAGE ===== */
/* Elegant, minimalist, high-end confirmation overlay */

.form-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.form-success-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.form-success-message {
    position: relative;
    max-width: 520px;
    width: 90%;
    padding: 48px 40px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.08) 25%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.10) 75%,
        rgba(255, 255, 255, 0.06) 100%
    );
    backdrop-filter: blur(32px) saturate(180%) brightness(1.15) contrast(1.1);
    -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.15) contrast(1.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 
        0 1px 0 0 rgba(255, 255, 255, 0.08) inset,
        0 12px 48px rgba(0, 0, 0, 0.3),
        0 6px 24px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(255, 255, 255, 0.05);
    text-align: center;
    transform: scale(0.8) translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

.form-success-overlay.active .form-success-message {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Success Icon with AI Generate Effect */
.form-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    transform: scale(1.2);
    filter: blur(20px) contrast(0.3) brightness(1.5);
    animation: iconGenerate 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes iconGenerate {
    0% {
        opacity: 0;
        transform: scale(1.2) rotate(-180deg);
        filter: blur(20px) contrast(0.3) brightness(1.5);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1) rotate(-90deg);
        filter: blur(8px) contrast(0.8) brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0px) contrast(1) brightness(1);
    }
}

.form-success-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    animation: ringPulse 1s ease-out 0.4s forwards;
}

@keyframes ringPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

.form-success-icon svg {
    width: 36px;
    height: 36px;
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkDraw 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.6s forwards;
}

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

/* Title with AI Generate Effect */
.form-success-title {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 900;
    margin: 0 0 16px 0;
    color: #FFFFFF;
    letter-spacing: -0.04em;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    line-height: 1.1;
    opacity: 0;
    transform: scale(1.05);
    filter: blur(20px) contrast(0.3) brightness(1.5);
    animation: titleGenerate 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

@keyframes titleGenerate {
    0% {
        opacity: 0;
        transform: scale(1.05);
        filter: blur(20px) contrast(0.3) brightness(1.5);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
        filter: blur(8px) contrast(0.8) brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px) contrast(1) brightness(1);
    }
}

/* Message text */
.form-success-text {
    font-size: clamp(15px, 2vw, 17px);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 0 0 32px 0;
    font-weight: 400;
    opacity: 0;
    transform: translateY(10px);
    animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0px);
    }
}

/* Close button */
.form-success-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    animation: buttonPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
}

@keyframes buttonPop {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    70% {
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-success-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.25),
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.form-success-close:active {
    transform: translateY(0) scale(0.98);
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.1s ease;
}

/* Auto-dismiss progress indicator */
.form-success-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0.6),
        rgba(255, 255, 255, 0.4)
    );
    border-radius: 0 0 24px 24px;
    width: 100%;
    transform-origin: left;
    animation: progressShrink 5s linear forwards;
}

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-success-message {
        padding: 40px 32px;
        max-width: 90%;
    }

    .form-success-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }

    .form-success-icon svg {
        width: 32px;
        height: 32px;
    }

    .form-success-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .form-success-text {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .form-success-close {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* Error message styling */
.form-error-overlay {
    /* Uses same base styles as success */
}

.form-error-message {
    /* Uses same base styles but with error colors */
}

.form-error-icon {
    background: linear-gradient(
        135deg,
        rgba(255, 100, 100, 0.15) 0%,
        rgba(255, 100, 100, 0.08) 100%
    );
    border: 2px solid rgba(255, 100, 100, 0.3);
}

.form-error-icon::before {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.4), rgba(255, 100, 100, 0.1));
}

.form-error-icon svg {
    stroke-dasharray: 0;
    stroke-dashoffset: 0;
    animation: errorShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.3s both;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .form-success-overlay,
    .form-success-message,
    .form-success-icon,
    .form-success-title,
    .form-success-text,
    .form-success-close {
        animation: simpleFadeIn 0.3s ease-out forwards !important;
        transition: opacity 0.3s ease !important;
    }

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

    .form-success-icon::before {
        animation: none !important;
    }

    .form-success-icon svg {
        animation: none !important;
        stroke-dashoffset: 0;
    }

    .form-success-progress {
        animation: progressShrinkSimple 5s linear forwards !important;
    }

    @keyframes progressShrinkSimple {
        from {
            width: 100%;
        }
        to {
            width: 0%;
        }
    }
}
