/* Form Styles - Sigma Commercial */

/* Form Container */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-container h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.form-group .required {
    color: var(--risk-very-high);
}

/* Input Fields */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.form-control::placeholder {
    color: #adb5bd;
}

/* Select Dropdown */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 3rem;
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Form Row (side by side inputs) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Validation States */
.form-control.is-valid {
    border-color: var(--risk-low);
}

.form-control.is-invalid {
    border-color: var(--risk-very-high);
}

.invalid-feedback {
    display: none;
    color: var(--risk-very-high);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid + .invalid-feedback {
    display: block;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.submit-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

/* Form Success/Error Messages */
.form-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--risk-low);
    color: var(--risk-low);
}

.form-message.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--risk-very-high);
    color: var(--risk-very-high);
}

/* Honeypot field (spam protection) */
.hp-field {
    position: absolute;
    left: -9999px;
}

/* Quote Form Specific */
.quote-form {
    max-width: 700px;
}

.quote-form .form-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Contact Form Specific */
.contact-form-section {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.contact-form-section h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 2rem;
}

/* Homepage Quote Section */
.homepage-quote-form {
    max-width: 500px;
    margin: 0 auto;
}

.homepage-quote-form .form-row {
    grid-template-columns: 1fr 1fr;
}

/* Inline Form (Newsletter style) */
.inline-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.inline-form .form-control {
    flex: 1;
}

.inline-form .submit-btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Lead Capture Form */
.lead-capture-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
}

.lead-capture-form h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.lead-capture-form .form-group {
    margin-bottom: 1rem;
}

.lead-capture-form .submit-btn {
    margin-top: 0.5rem;
}

/* Checkbox and Radio styling */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.checkbox-label input,
.radio-label input {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span,
.radio-label span {
    line-height: 1.5;
}

/* Form Privacy Note */
.privacy-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1rem;
}

.privacy-note a {
    color: var(--primary-blue);
    text-decoration: none;
}

.privacy-note a:hover {
    text-decoration: underline;
}

/* Loading State */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Email Provider Modal */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    box-sizing: border-box;
}

.email-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.email-modal-content h2 {
    margin: 0 0 1.5rem 0;
    color: var(--primary-dark);
    text-align: center;
    font-size: 1.5rem;
}

.email-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}

.email-modal-close:hover {
    color: #333;
}

.email-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
}

.email-preview p {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.email-preview p:last-of-type {
    margin-bottom: 0;
}

.email-body-preview {
    margin-top: 1rem;
}

.email-body-preview strong {
    display: block;
    margin-bottom: 0.5rem;
}

.email-body-preview pre {
    margin: 0;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.9rem;
    max-height: 150px;
    overflow-y: auto;
}

.email-instruction {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.email-options {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.email-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 110px;
}

.email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.email-btn:active {
    transform: translateY(0);
}

.email-btn.default {
    background: var(--primary-blue, #0056b3);
    color: white;
}

.email-btn.default:hover {
    background: #004494;
}

.email-btn.gmail {
    background: #ea4335;
    color: white;
}

.email-btn.gmail:hover {
    background: #d33426;
}

.email-btn.copy {
    background: #6c757d;
    color: white;
}

.email-btn.copy:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 1.5rem;
    }

    .inline-form {
        flex-direction: column;
    }

    .inline-form .submit-btn {
        width: 100%;
    }

    .email-modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .email-options {
        flex-direction: column;
    }

    .email-btn {
        width: 100%;
    }
}
