/**
 * Contact Form Styles
 * Lightweight, modal-ready contact form styling
 */

/* Form Container */
.ehs-contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

.ehs-contact-form .ehs-form-field {
    margin-bottom: 1.5rem;
}

.ehs-contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.ehs-contact-form .required {
    color: #d32f2f;
}

.ehs-contact-form input[type="text"],
.ehs-contact-form input[type="email"],
.ehs-contact-form input[type="tel"],
.ehs-contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.ehs-contact-form input[type="text"]:focus,
.ehs-contact-form input[type="email"]:focus,
.ehs-contact-form input[type="tel"]:focus,
.ehs-contact-form textarea:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.ehs-contact-form input.error,
.ehs-contact-form textarea.error {
    border-color: #d32f2f;
}

.ehs-contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.ehs-contact-form .ehs-form-submit {
    margin-top: 2rem;
    margin-bottom: 0;
}

.ehs-contact-form .ehs-submit-btn {
    width: 100%;
    padding: 0.875rem 2rem;
    background-color: #003366;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

.ehs-contact-form .ehs-submit-btn:hover:not(:disabled) {
    background-color: #004080;
}

.ehs-contact-form .ehs-submit-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.ehs-contact-form .ehs-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ehs-contact-form .btn-loader svg {
    animation: spin 1s linear infinite;
}

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

/* Form Messages */
.ehs-form-messages {
    display: none;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.ehs-form-messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ehs-form-messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ehs-form-messages p {
    margin: 0;
}

/* Honeypot (hidden) */
.ehs-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Modal Styles */
.ehs-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    overflow-y: auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.ehs-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ehs-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

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

.ehs-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.ehs-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #003366;
}

.ehs-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.ehs-modal-close:hover {
    background-color: #f5f5f5;
    color: #000;
}

.ehs-modal-body {
    padding: 2rem;
}

.ehs-modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.875rem;
    color: #666;
}

/* Prevent body scroll when modal is open */
body.ehs-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .ehs-modal {
        max-width: 100%;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .ehs-modal-header,
    .ehs-modal-body {
        padding: 1.5rem;
    }

    .ehs-modal-title {
        font-size: 1.25rem;
    }
}
