/* form-messages.css - Styling for modern modal dialogs */

/* Modal Overlay */
.form-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.form-modal-overlay.show {
    opacity: 1;
}

/* Modal Container */
.form-modal {
    background: white;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.form-modal-overlay.show .form-modal {
    transform: scale(1) translateY(0);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #475569;
    transform: rotate(90deg);
}

/* Icon Wrapper */
.modal-icon-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-modal-success .modal-icon-wrapper {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
}

.form-modal-error .modal-icon-wrapper {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.4);
}

.modal-icon {
    width: 50px;
    height: 50px;
    color: white;
    animation: iconDraw 0.5s ease 0.3s both;
}

/* Title */
.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #1e293b;
}

.form-modal-success .modal-title {
    color: #059669;
}

.form-modal-error .modal-title {
    color: #dc2626;
}

/* Message */
.modal-message {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 2rem 0;
}

/* Action Buttons */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-modal {
    min-width: 180px;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.form-modal-success .btn-modal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.form-modal-success .btn-modal:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.form-modal-error .btn-modal {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
}

.form-modal-error .btn-modal:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.4);
}

/* Animations */
@keyframes iconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes iconDraw {
    0% {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .form-modal {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    .modal-icon-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .modal-icon {
        width: 40px;
        height: 40px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-message {
        font-size: 1rem;
    }
    
    .btn-modal {
        width: 100%;
        min-width: unset;
    }
}

/* Old styles for compatibility */
.form-message {
    padding: 3rem 2rem;
    border-radius: 12px;
    animation: slideIn 0.5s ease-out;
    text-align: center;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.form-message-success {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
}

.form-message-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
}

.form-message-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-message-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.form-message-success .form-message-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
}

.form-message-error .form-message-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.form-message-text {
    max-width: 600px;
}

.form-message-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #1e293b;
}

.form-message-success .form-message-title {
    color: #0369a1;
}

.form-message-error .form-message-title {
    color: #b91c1c;
}

.form-message-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #475569;
    margin: 0;
}

.form-message-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.form-message-actions .btn {
    min-width: 180px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.form-message-actions .btn-secondary {
    background: white;
    color: #475569;
    border: 2px solid #cbd5e1;
}

.form-message-actions .btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-message-actions .btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border: none;
}

.form-message-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0891b2 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.form-message-card {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .form-message {
        padding: 2rem 1rem;
    }

    .form-message-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .form-message-title {
        font-size: 1.5rem;
    }

    .form-message-description {
        font-size: 1rem;
    }

    .form-message-actions {
        flex-direction: column;
    }

    .form-message-actions .btn {
        width: 100%;
        min-width: unset;
    }
}

/* Additional decorative elements */
.form-message::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: pulse 4s ease-in-out infinite;
}

.form-message-success::before {
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 70%);
}

.form-message-error::before {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.05) 0%, transparent 70%);
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Card positioning for message */
.form-message-card .form-message {
    position: relative;
    overflow: hidden;
}

/* Loading spinner for submit button */
button[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

button[type="submit"] {
    transition: all 0.3s ease;
}

/* Form fade out animation */
form.form-submitting {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}
