/**
 * ContactForm Molecule Styles
 * 
 * Professional contact form styling combining Input, Textarea, and Button atoms.
 * Follows Atomic Design principles with enhanced UX features.
 * 
 * @package Mendene_Location
 * @subpackage CSS\Molecules
 * @version 1.0.0
 */

/* ============================================
   BASE FORM STYLES
   ============================================ */

.contact-form {
    width: 100%;
    max-width: 100%;
}

.contact-form--page {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.contact-form--page:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ============================================
   FORM FIELDS CONTAINER
   ============================================ */

.contact-form .input-container,
.contact-form .textarea-container {
    margin-bottom: 28px;
}

.contact-form .input-container:last-of-type,
.contact-form .textarea-container:last-of-type {
    margin-bottom: 0;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.contact-form__actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
}

.contact-form__submit {
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-form__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(125, 64, 150, 0.3);
}

.contact-form__submit:active:not(:disabled) {
    transform: translateY(0);
}

/* ============================================
   FORM VALIDATION STATES
   ============================================ */

.contact-form--validating .input,
.contact-form--validating .textarea {
    transition: all 0.3s ease;
}

.contact-form--submitting .contact-form__submit {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.contact-form--submitting .contact-form__submit .icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   FORM SUCCESS STATE
   ============================================ */

.contact-form--success {
    position: relative;
}

.contact-form--success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(39, 174, 96, 0.05);
    border-radius: 20px;
    border: 2px solid #27ae60;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   FORM ERROR STATE
   ============================================ */

.contact-form--error {
    animation: shake 0.5s ease;
}

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

/* ============================================
   FORM MESSAGES
   ============================================ */

.contact-form__message {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

.contact-form__message--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contact-form__message--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.contact-form__message--info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   FORM PROGRESS INDICATOR
   ============================================ */

.contact-form__progress {
    width: 100%;
    height: 4px;
    background-color: #e8e8e8;
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.contact-form__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7D4096 0%, #AB5092 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.contact-form--submitting .contact-form__progress-bar {
    width: 100%;
    animation: progress 2s ease infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .contact-form--page {
        padding: 30px 24px;
        border-radius: 16px;
    }
    
    .contact-form .input-container,
    .contact-form .textarea-container {
        margin-bottom: 24px;
    }
    
    .contact-form__actions {
        margin-top: 28px;
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .contact-form--page {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .contact-form .input-container,
    .contact-form .textarea-container {
        margin-bottom: 20px;
    }
    
    .contact-form__actions {
        margin-top: 24px;
        padding-top: 16px;
    }
    
    .contact-form__message {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.contact-form:focus-within {
    outline: none;
}

.contact-form__submit:focus-visible {
    outline: 3px solid #7D4096;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .contact-form--error,
    .contact-form__message,
    .contact-form__progress-bar {
        animation: none;
    }
    
    .contact-form__submit:hover:not(:disabled) {
        transform: none;
    }
}

