/* 
 * Form Styles
 * Contains styles for forms and form elements
 */

/* Contact Form Container */
.contact-form-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.contact-form {
    padding: 2rem;
}

.form-header {
    margin-bottom: 1.5rem;
}

.form-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Form Group */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    transition: all 0.3s ease;
    background-color: white;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: #cfd7e3;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: white;
}

.form-group.focused label {
    color: var(--primary-color);
}

.form-group.filled label {
    font-weight: 500;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    margin-top: 1.5rem;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.newsletter-form input:hover {
    border-color: #cfd7e3;
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: white;
    outline: none;
}

.newsletter-form button {
    padding: 0.75rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
    transform: translateX(2px);
}

/* CTA Card Newsletter Form */
.cta-card .newsletter-form {
    flex-direction: column;
    box-shadow: none;
}

.cta-card .newsletter-form input {
    width: 100%;
    border-radius: var(--border-radius-sm);
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.cta-card .newsletter-form button {
    width: 100%;
    border-radius: var(--border-radius-sm);
    padding: 0.875rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-card .newsletter-form button::after {
    content: '→';
    position: absolute;
    right: -20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.cta-card .newsletter-form button:hover::after {
    right: 1rem;
    opacity: 1;
}

.cta-card .newsletter-form button:hover {
    padding-right: 2.5rem;
}

/* Footer Form */
.footer-form {
    display: flex;
    height: 45px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.footer-form input {
    flex-grow: 1;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    transition: all 0.3s ease;
}

.footer-form input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

.footer-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.footer-form button {
    width: 45px;
    background: var(--accent-color);
    color: var(--text-dark);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-form button:hover {
    background: white;
    width: 55px;
}

/* Checkbox Styling */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-group label {
    position: relative;
    padding-left: 1.75rem;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    font-weight: normal;
}

.checkbox-group label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 1.125rem;
    height: 1.125rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked + label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-group input[type="checkbox"]:checked + label::after {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 0.5rem;
    width: 0.375rem;
    height: 0.5rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-group input[type="checkbox"]:focus + label::before {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Form Feedback States */
.error-message {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-message::before {
    content: '⚠️';
    margin-right: 0.5rem;
    font-size: 1rem;
}

.success-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    text-align: center;
    margin-top: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Input Placeholders */
input::placeholder,
textarea::placeholder {
    color: #a0aec0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

input:focus::placeholder,
textarea:focus::placeholder {
    opacity: 0.5;
}

/* Form validation */
input.form-error,
textarea.form-error {
    border-color: var(--error-color) !important;
    background-color: rgba(239, 68, 68, 0.05);
}

.field-filled {
    border-color: var(--primary-color) !important;
    background-color: rgba(37, 99, 235, 0.02) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .newsletter-form button {
        width: 100%;
    }
}
