/**
 * GFA PSEO Contact Form Modal Styles
 *
 * Stylesheet for the public-facing contact form modal including form fields,
 * validation states, GDPR compliance elements, and responsive behavior.
 *
 * @package    GFA_PSEO
 * @subpackage Public/CSS
 * @since      1.0.0
 */

/* ==========================================================================
   Reset & Base
   ========================================================================== */

.gfa-pseo-contact-modal,
.gfa-pseo-contact-modal *,
.gfa-pseo-contact-modal *::before,
.gfa-pseo-contact-modal *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Modal Container
   ========================================================================== */

.gfa-pseo-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.gfa-pseo-contact-modal.active {
    display: flex;
}

.gfa-pseo-contact-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.gfa-pseo-contact-modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--gfa-pseo-border-radius, 12px);
    width: 100%;
    max-width: var(--gfa-pseo-modal-width, 540px);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: gfaPseoModalSlideIn 0.3s ease;
    margin: 0 auto;
}

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

/* ==========================================================================
   Modal Header
   ========================================================================== */

.gfa-pseo-contact-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.gfa-pseo-contact-modal-header h2 {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.gfa-pseo-contact-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.gfa-pseo-contact-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ==========================================================================
   Modal Body
   ========================================================================== */

.gfa-pseo-contact-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.gfa-pseo-contact-form {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.gfa-pseo-form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.gfa-pseo-form-field {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.gfa-pseo-field-full {
    width: 100%;
    flex: 0 0 100%;
}

.gfa-pseo-field-half {
    width: calc(50% - 8px);
    flex: 0 0 calc(50% - 8px);
}

.gfa-pseo-form-field label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    display: block;
}

.gfa-pseo-required {
    color: #d63638;
}

.gfa-pseo-form-field input[type="text"],
.gfa-pseo-form-field input[type="email"],
.gfa-pseo-form-field input[type="tel"],
.gfa-pseo-form-field textarea,
.gfa-pseo-form-field select {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: var(--gfa-pseo-field-radius, 8px);
    background: #fff;
    transition: all 0.2s;
    font-family: inherit;
    margin: 0;
}

.gfa-pseo-form-field input:focus,
.gfa-pseo-form-field textarea:focus,
.gfa-pseo-form-field select:focus {
    outline: none;
    border-color: var(--gfa-pseo-button-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(var(--gfa-pseo-button-color-rgb, 34, 113, 177), 0.15);
}

.gfa-pseo-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.gfa-pseo-form-field.has-error input,
.gfa-pseo-form-field.has-error textarea,
.gfa-pseo-form-field.has-error select {
    border-color: #d63638;
}

.gfa-pseo-form-field.has-error input:focus,
.gfa-pseo-form-field.has-error textarea:focus,
.gfa-pseo-form-field.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.15);
}

.gfa-pseo-field-error {
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.gfa-pseo-form-field.has-error .gfa-pseo-field-error {
    display: block;
}

/* Checkbox */
.gfa-pseo-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.5;
    margin: 0;
}

.gfa-pseo-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 2px 0 0 0;
    flex-shrink: 0;
}

/* ==========================================================================
   GDPR Field
   ========================================================================== */

.gfa-pseo-gdpr-field {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    width: 100%;
}

.gfa-pseo-gdpr-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    line-height: 1.5;
    margin: 0;
}

.gfa-pseo-gdpr-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 2px 0 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.gfa-pseo-gdpr-text {
    flex: 1;
}

.gfa-pseo-gdpr-text a {
    color: var(--gfa-pseo-button-color, #2271b1);
    text-decoration: underline;
}

.gfa-pseo-gdpr-text a:hover {
    color: var(--gfa-pseo-button-hover-color, #1a5a8e);
}

.gfa-pseo-gdpr-error {
    margin-top: 6px;
    margin-left: 30px;
}

.gfa-pseo-gdpr-field.has-error .gfa-pseo-gdpr-error {
    display: block;
    color: #d63638;
    font-size: 12px;
}

/* ==========================================================================
   Form Footer
   ========================================================================== */

.gfa-pseo-form-footer {
    margin-top: 24px;
    width: 100%;
}

.gfa-pseo-submit-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--gfa-pseo-button-color, #2271b1);
    border: none;
    border-radius: var(--gfa-pseo-field-radius, 8px);
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.gfa-pseo-submit-btn:hover {
    background: var(--gfa-pseo-button-hover-color, #1a5a8e);
}

.gfa-pseo-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gfa-pseo-submit-btn.loading {
    position: relative;
    color: transparent;
}

.gfa-pseo-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gfaPseoSpinner 0.8s linear infinite;
}

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

/* ==========================================================================
   Form Message
   ========================================================================== */

.gfa-pseo-form-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--gfa-pseo-field-radius, 8px);
    font-size: 14px;
    display: none;
    width: 100%;
}

.gfa-pseo-form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.gfa-pseo-form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Honeypot (Hidden)
   ========================================================================== */

.gfa-pseo-hp-field {
    position: absolute !important;
    left: -9999px !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 600px) {
    .gfa-pseo-contact-modal {
        padding: 10px;
    }

    .gfa-pseo-contact-modal-content {
        max-height: 95vh;
    }

    .gfa-pseo-contact-modal-header {
        padding: 16px 20px;
    }

    .gfa-pseo-contact-modal-header h2 {
        font-size: 18px;
    }

    .gfa-pseo-contact-modal-body {
        padding: 20px;
    }

    .gfa-pseo-field-half {
        width: 100%;
        flex: 0 0 100%;
    }
}
