/**
 * DSGVO Contact Form Styles
 * Professional B2B design for German contact forms
 */

/* Form Container */
.dsgvo-contact-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.dsgvo-contact-form-title {
    margin: 0 0 25px 0;
    color: #333333;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    border-bottom: 3px solid #007cba;
    padding-bottom: 15px;
}

/* Form Layout */
.dsgvo-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dsgvo-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.dsgvo-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.dsgvo-form-half {
    flex: 1;
    min-width: 200px;
}

/* Form Labels */
.dsgvo-form-label {
    font-weight: 600;
    color: #333333;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.dsgvo-required {
    color: #dc3545;
    font-weight: 700;
}

.dsgvo-optional {
    color: #666666;
    font-weight: 400;
    font-style: italic;
}

/* Form Inputs */
.dsgvo-form-input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    color: #333333;
    background-color: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.dsgvo-form-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.dsgvo-form-input:invalid {
    border-color: #dc3545;
}

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

/* Textarea */
textarea.dsgvo-form-input {
    resize: vertical;
    min-height: 120px;
    max-height: 300px;
}

/* Select */
select.dsgvo-form-input {
    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 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Character Counter */
.dsgvo-char-count {
    font-size: 12px;
    color: #666666;
    text-align: right;
    margin-top: 5px;
}

.dsgvo-char-warning {
    color: #dc3545;
    font-weight: 600;
}

/* Field Validation */
.dsgvo-field-invalid .dsgvo-form-input {
    border-color: #dc3545;
    background-color: #ffeaea;
}

.dsgvo-field-error {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
    display: block;
}

/* DSGVO Consent Section */
.dsgvo-consent-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 10px;
}

.dsgvo-consent-section h4 {
    margin: 0 0 20px 0;
    color: #333333;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
}

.dsgvo-consent-group {
    margin-bottom: 20px;
}

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

.dsgvo-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #007cba;
    flex-shrink: 0;
    margin-top: 2px;
}

.dsgvo-checkbox-text {
    color: #333333;
    line-height: 1.6;
}

.dsgvo-privacy-links {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.dsgvo-privacy-links p {
    margin: 0;
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
}

.dsgvo-privacy-links a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.dsgvo-privacy-links a:hover {
    text-decoration: underline;
}

/* Submit Section */
.dsgvo-form-submit {
    text-align: center;
    margin-top: 25px;
}

.dsgvo-submit-btn {
    background: #007cba;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 200px;
    line-height: 1;
}

.dsgvo-submit-btn:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.dsgvo-submit-btn:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dsgvo-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3);
}

/* Loading State */
.dsgvo-submit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

/* Form Messages */
.dsgvo-form-messages {
    margin-top: 20px;
}

.dsgvo-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

.dsgvo-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dsgvo-contact-form-wrapper {
        margin: 20px;
        padding: 20px;
    }

    .dsgvo-contact-form-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .dsgvo-form-row {
        flex-direction: column;
        gap: 20px;
    }

    .dsgvo-form-half {
        min-width: auto;
    }

    .dsgvo-form-input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .dsgvo-consent-section {
        padding: 20px;
    }

    .dsgvo-checkbox-label {
        font-size: 13px;
    }

    .dsgvo-submit-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .dsgvo-contact-form-wrapper {
        margin: 10px;
        padding: 15px;
        border-radius: 6px;
    }

    .dsgvo-contact-form-title {
        font-size: 22px;
    }

    .dsgvo-form-input {
        padding: 12px;
        font-size: 16px;
    }

    .dsgvo-consent-section {
        padding: 15px;
    }

    .dsgvo-consent-section h4 {
        font-size: 16px;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .dsgvo-contact-form-wrapper {
        border-width: 3px;
    }

    .dsgvo-form-input {
        border-width: 3px;
    }

    .dsgvo-submit-btn {
        border: 3px solid #000000;
    }

    .dsgvo-consent-section {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dsgvo-form-input,
    .dsgvo-submit-btn {
        transition: none;
    }

    .dsgvo-spinner {
        animation: none;
    }

    .dsgvo-submit-btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Print styles */
@media print {
    .dsgvo-contact-form-wrapper {
        box-shadow: none;
        border: 1px solid #000000;
    }

    .dsgvo-submit-btn {
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }

    .dsgvo-form-messages {
        display: none;
    }
}