/**
 * Frontend CSS für Werdelmann Contact Forms
 */

.wcf-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wcf-form-header {
    margin-bottom: 30px;
    text-align: center;
}

.wcf-form-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.wcf-form-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.wcf-form {
    width: 100%;
}

.wcf-form-fields {
    margin-bottom: 30px;
}

.wcf-field-group {
    margin-bottom: 20px;
    position: relative;
}

.wcf-field-group.has-error .wcf-input,
.wcf-field-group.has-error .wcf-textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.wcf-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.wcf-required {
    color: #e74c3c;
    margin-left: 4px;
}

.wcf-optional {
    color: #999;
    font-weight: normal;
    font-size: 12px;
}

.wcf-input,
.wcf-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #fff;
}

.wcf-input:focus,
.wcf-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.wcf-field-readonly .wcf-input {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.wcf-field-error {
    color: var(--color-error);
    font-size: 12px;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    text-align: right;
}

.wcf-form-actions {
    text-align: center;
}

.wcf-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 160px;
}

.wcf-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.wcf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wcf-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wcf-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: wcf-spin 1s linear infinite;
}

@keyframes wcf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wcf-form-messages {
    position: fixed;
    top: 1rem;
    left: var(--site-padding, 1rem);
}

.wcf-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.wcf-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcf-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* DSGVO-Einverständnis */
.gdpr-consent {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.form-checkbox input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-checkbox .label-text {
    color: #333;
}

.form-checkbox .label-text a {
    color: #3498db;
    text-decoration: none;
}

.form-checkbox .label-text a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wcf-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .wcf-form-header h3 {
        font-size: 20px;
    }
    
    .wcf-form-header p {
        font-size: 14px;
    }
    
    .wcf-input,
    .wcf-textarea {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .wcf-submit-btn {
        width: 100%;
        padding: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wcf-form-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .wcf-form-header h3 {
        color: #ecf0f1;
    }
    
    .wcf-form-header p {
        color: #bdc3c7;
    }
    
    .wcf-label {
        color: #ecf0f1;
    }
    
    .wcf-input,
    .wcf-textarea {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .wcf-input:focus,
    .wcf-textarea:focus {
        border-color: #3498db;
    }
    
    .wcf-field-readonly .wcf-input {
        background-color: #2c3e50;
        color: #7f8c8d;
    }
    
    .gdpr-consent {
        background-color: #34495e;
        border-color: #4a5f7a;
    }
    
    .form-checkbox .label-text {
        color: #ecf0f1;
    }
}

/* Accessibility */
.wcf-form:focus-within .wcf-submit-btn {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wcf-input,
    .wcf-textarea {
        border-width: 3px;
    }
    
    .wcf-submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wcf-input,
    .wcf-textarea,
    .wcf-submit-btn {
        transition: none;
    }
    
    .wcf-spinner {
        animation: none;
    }
}
