/* ===== NATIVE FORM STYLING (Fallback & HubSpot Compatible) ===== */

/* Form Container */
.native-form {
    width: 100%;
}

/* Form Fields */
.form-field {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-field.focused {
    position: relative;
}

.form-field label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-field label .required {
    color: #e53e3e;
    margin-left: 2px;
}

/* Input Styling */
.form-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-input.focused {
    border-color: var(--accent-color);
}

.form-input::placeholder {
    color: #a0aec0;
    opacity: 1;
}

/* Textarea */
textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Select Dropdown */
select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a365d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

select.form-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Error State */
.form-input.error {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.form-field.has-error .form-input {
    border-color: #e53e3e;
}

.error-message {
    display: none;
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

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

/* Submit Button */
.submit-button {
    width: 100%;
    background: var(--accent-color);
    color: var(--bg-white);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-button:hover:not(:disabled) {
    background: #c19d2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

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

.button-loader {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.native-form.submitting .button-text {
    display: none !important;
}

.native-form.submitting .button-loader {
    display: inline-flex !important;
}

/* Spinner Animation */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Form Notice */
.form-notice {
    margin-top: 1rem;
    text-align: center;
}

.form-notice small {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.4;
}

.form-notice a {
    color: var(--accent-color);
    text-decoration: underline;
}

.form-notice a:hover {
    color: #c19d2f;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
    border-radius: 1rem;
    animation: slideInUp 0.5s ease-out;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.5s ease-out 0.2s both;
}

.success-message h3 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    animation: fadeIn 0.5s ease-out 0.3s both;
}

.success-message p {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.success-message .btn-secondary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    animation: fadeIn 0.5s ease-out 0.5s both;
}

.success-message .btn-secondary:hover {
    background: #0f2a4d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.3);
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Form State Classes */
.form-initialized {
    animation: fadeIn 0.5s ease-out;
}

.form-submitted {
    animation: slideInUp 0.5s ease-out;
}

/* HubSpot Form Compatibility */
.hubspot-active .hs-form {
    /* HubSpot forms use their own styling */
}

.native-active .native-form {
    /* Native form is visible */
}

/* Loading State for Container */
.hubspot-form:not(.form-initialized) {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hubspot-form:not(.form-initialized)::after {
    content: 'Loading form...';
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .form-field {
        margin-bottom: 1rem;
    }
    
    .form-input {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .submit-button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .success-message {
        padding: 2rem 1.5rem;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .success-message h3 {
        font-size: 1.5rem;
    }
    
    .success-message p {
        font-size: 0.95rem;
    }
}

/* Focus Visible for Accessibility */
.form-input:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.submit-button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .submit-button,
    .form-notice {
        display: none;
    }
}
