/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-8);
    background-color: hsl(var(--surface));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: hsl(var(--text-primary));
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    background-color: hsl(var(--surface));
    color: hsl(var(--text-primary));
    transition: all var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

input[type="text"]:invalid,
input[type="email"]:invalid,
input[type="tel"]:invalid,
select:invalid,
textarea:invalid {
    border-color: hsl(0 70% 50%);
}

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

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Checkbox and Radio Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: hsl(var(--primary));
    cursor: pointer;
}

.checkbox-label.consent {
    font-size: 0.875rem;
    color: hsl(var(--text-secondary));
}

.checkbox-label.newsletter {
    font-size: 0.875rem;
    color: hsl(var(--text-secondary));
}

/* Form Submit */
.form-submit {
    text-align: center;
    margin-top: var(--space-8);
}

.form-note {
    margin-top: var(--space-4);
    font-size: 0.875rem;
    color: hsl(var(--text-muted));
}

/* Contact Form Specific */
.contact-form-container {
    background-color: hsl(var(--surface));
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid hsl(var(--border));
}

.contact-form h2 {
    margin-bottom: var(--space-2);
    color: hsl(var(--text-primary));
}

.contact-form > p {
    margin-bottom: var(--space-8);
    color: hsl(var(--text-secondary));
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: start;
}

@media (min-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Contact Details */
.contact-details h2 {
    margin-bottom: var(--space-6);
}

.contact-methods {
    margin-top: var(--space-8);
}

.contact-method {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    padding: var(--space-6);
    background-color: hsl(var(--neutral-50));
    border-radius: var(--radius-lg);
    border-left: 4px solid hsl(var(--primary));
}

.contact-method:last-child {
    margin-bottom: 0;
}

.contact-icon {
    width: 48px;
    height: 48px;
    color: hsl(var(--primary));
    flex-shrink: 0;
}

.method-details h3 {
    margin-bottom: var(--space-2);
    color: hsl(var(--text-primary));
}

.method-details p {
    margin-bottom: var(--space-1);
    color: hsl(var(--text-secondary));
}

.method-details p:last-child {
    margin-bottom: 0;
}

.method-note {
    font-size: 0.875rem;
    color: hsl(var(--text-muted));
    font-style: italic;
}

.social-contact {
    margin-top: var(--space-10);
}

.social-contact h3 {
    margin-bottom: var(--space-4);
}

/* Form Validation */
.form-error {
    color: hsl(0 70% 50%);
    font-size: 0.875rem;
    margin-top: var(--space-2);
    display: none;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: hsl(0 70% 50%);
    background-color: hsl(0 70% 50% / 0.05);
}

.form-group.error .form-error {
    display: block;
}

/* Form Success */
.form-success {
    background-color: hsl(var(--accent) / 0.1);
    border: 1px solid hsl(var(--accent) / 0.3);
    color: hsl(var(--accent));
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: none;
}

.form-success.show {
    display: block;
}

/* Loading State */
.form-loading {
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: hsl(var(--surface) / 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
}

/* Newsletter Form */
.newsletter-form input {
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.9);
    color: hsl(var(--text-primary));
}

.newsletter-form input::placeholder {
    color: hsl(var(--text-muted));
}

.newsletter-form input:focus {
    border-color: hsl(var(--secondary));
    background-color: white;
    outline: none;
}

/* Contact FAQ */
.contact-faq {
    background-color: hsl(var(--neutral-50));
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.faq-item {
    background-color: hsl(var(--surface));
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.faq-item h3 {
    color: hsl(var(--primary));
    margin-bottom: var(--space-3);
    font-size: 1.125rem;
}

.faq-item p {
    margin-bottom: 0;
    color: hsl(var(--text-secondary));
}

/* Form Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group.error {
    animation: shake 0.5s ease-in-out;
}

/* Responsive Form Styles */
@media (max-width: 640px) {
    .form-container,
    .contact-form-container {
        padding: var(--space-4);
        margin: var(--space-4);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-method {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-icon {
        margin: 0 auto var(--space-3);
    }
}

/* Focus Improvements */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
}

/* Disabled State */
input:disabled,
select:disabled,
textarea:disabled {
    background-color: hsl(var(--neutral-100));
    color: hsl(var(--text-muted));
    cursor: not-allowed;
    opacity: 0.6;
}

/* Required Fields */
label[for] .required::after {
    content: ' *';
    color: hsl(0 70% 50%);
}

/* File Upload (if needed) */
input[type="file"] {
    padding: var(--space-2);
    border: 2px dashed hsl(var(--border));
    background-color: hsl(var(--neutral-50));
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: hsl(var(--primary));
}

input[type="file"]:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Character Counter */
.char-counter {
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
    text-align: right;
    margin-top: var(--space-1);
}

/* Form Progress (for multi-step forms) */
.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: hsl(var(--border));
    z-index: 1;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: hsl(var(--surface));
    border: 2px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: hsl(var(--text-muted));
    position: relative;
    z-index: 2;
}

.progress-step.active {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: white;
}

.progress-step.completed {
    background-color: hsl(var(--accent));
    border-color: hsl(var(--accent));
    color: white;
}

/* Form Sections */
.form-section {
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid hsl(var(--border));
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    color: hsl(var(--primary));
    margin-bottom: var(--space-6);
    font-size: 1.25rem;
}

/* Floating Labels */
.floating-label {
    position: relative;
}

.floating-label input,
.floating-label textarea {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.floating-label label {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    background-color: hsl(var(--surface));
    padding: 0 var(--space-1);
    color: hsl(var(--text-muted));
    font-weight: normal;
    transition: all var(--transition-fast);
    pointer-events: none;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:focus + label,
.floating-label textarea:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.75rem;
    color: hsl(var(--primary));
    font-weight: 600;
}

/* Print Styles for Forms */
@media print {
    .form-container,
    .contact-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn-primary,
    .btn-secondary {
        background-color: transparent !important;
        color: black !important;
        border: 1px solid black !important;
    }
}
