/**
 * Styles for XGEN-WAP Contact Form Gutenberg Block
 */

.xgen-contact-form-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    margin: 1.5rem auto;
    font-family: inherit;
    color: inherit;
}

.xgen-contact-form-wrap * {
    box-sizing: border-box;
}

.xgen-contact-form-title {
    margin: 0 0 1.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.xgen-form-group {
    margin-bottom: 1.25rem;
}

.xgen-form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.xgen-required {
    color: #dc2626;
    margin-left: 0.15rem;
}

.xgen-form-input,
.xgen-form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2937;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.xgen-form-input:focus,
.xgen-form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

.xgen-input-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.xgen-field-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #dc2626;
    min-height: 1rem;
}

.xgen-form-submit {
    margin-top: 1.5rem;
}

.xgen-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
    min-width: 140px;
}

.xgen-submit-button:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.xgen-submit-button:active:not(:disabled) {
    transform: scale(0.98);
}

.xgen-submit-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.xgen-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: xgen-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes xgen-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert notifications */
.xgen-contact-alert {
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.xgen-alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.xgen-alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Anti-spam honeypot styles */
.xgen-contact-hp-field {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Gutenberg Editor Preview Styling */
.xgen-contact-form-editor-preview {
    margin: 1.5rem 0;
}

.xgen-contact-preview-box {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #f8fafc;
    position: relative;
}

.xgen-contact-preview-badge {
    position: absolute;
    top: -12px;
    right: 16px;
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xgen-preview-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.xgen-preview-field {
    margin-bottom: 1rem;
}

.xgen-preview-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #475569;
}

.xgen-preview-field input,
.xgen-preview-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #64748b;
}

.xgen-preview-btn {
    padding: 0.6rem 1.2rem;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: default;
}
