/* ============================================================
   Firmenwagen Problemmeldung - External Stylesheet
   Dark/Light Theme mit CSS-Variablen
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--background);
    min-height: 100vh;
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header-bar {
    background: var(--card);
    color: var(--foreground);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.header-bar a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.header-bar a:hover {
    opacity: 0.8;
}


.container {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
}

/* ---- Main Content (shown after language selection) ---- */
.main-content {
    display: none;
}

.language-selector {
    background: var(--card);
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.change-language-btn {
    background: none;
    border: 2px solid var(--border);
    color: var(--foreground);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    width: fit-content;
    min-height: 44px;
}

.change-language-btn:hover,
.change-language-btn:active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.current-flag {
    font-size: 16px;
}

.header {
    border-bottom: 1px solid var(--border);
    background: var(--card);
    padding: 25px 15px;
    text-align: center;
    color: var(--foreground);
    transition: background-color 0.3s ease;
}

.header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--foreground);
    font-weight: bold;
    line-height: 1.2;
}

.header p {
    font-size: 0.95em;
    opacity: 0.9;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.form-content {
    padding: 15px;
    background: var(--background);
    transition: background-color 0.3s ease;
}

/* ---- Consent Section ---- */
.consent-section {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px 15px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.consent-section h3 {
    color: var(--foreground);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.consent-text {
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ---- Checkbox Container (Consent) ---- */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.checkbox-container:hover {
    border-color: var(--primary);
    background-color: var(--background);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkbox-container::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-container span {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.95em;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
}

.checkbox-container:has(input[type="checkbox"]:checked) {
    border-color: var(--primary);
    background: var(--background);
}

.checkbox-container:has(input[type="checkbox"]:checked)::before {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-container:has(input[type="checkbox"]:checked)::after {
    content: "✓";
    position: absolute;
    left: 19px;
    top: 19px;
    color: var(--primary-foreground);
    font-weight: bold;
    font-size: 14px;
}

.checkbox-container:active {
    transform: translateY(0);
}

.checkbox-container:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---- Form Section ---- */
.form-section {
    margin-bottom: 25px;
    padding: 20px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    transition: background-color 0.3s ease;
}

.form-section h3 {
    color: var(--foreground);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    font-size: 1.1em;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 15px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--background);
    color: var(--foreground);
    min-height: 52px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted-foreground);
}

.form-group select option {
    background: var(--card);
    color: var(--foreground);
}

/* ---- Radio Items ---- */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.radio-item:hover {
    border-color: var(--primary);
    background-color: var(--background);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-item label {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.95em;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
    margin: 0;
}

.radio-item:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: var(--background);
}

.radio-item:has(input[type="radio"]:checked)::before {
    background: var(--primary);
    border-color: var(--primary);
}

.radio-item:has(input[type="radio"]:checked)::after {
    content: "✓";
    position: absolute;
    left: 19px;
    top: 19px;
    color: var(--primary-foreground);
    font-weight: bold;
    font-size: 14px;
}

.radio-item:active {
    transform: translateY(0);
}

.radio-item:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---- Checkbox Grid Items ---- */
.checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background-color: var(--background);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-item::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-item label {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.95em;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
    margin: 0;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
    border-color: var(--primary);
    background: var(--background);
}

.checkbox-item:has(input[type="checkbox"]:checked)::before {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-item:has(input[type="checkbox"]:checked)::after {
    content: "✓";
    position: absolute;
    left: 19px;
    top: 19px;
    color: var(--primary-foreground);
    font-weight: bold;
    font-size: 14px;
}

.checkbox-item:active {
    transform: translateY(0);
}

.checkbox-item:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---- Photo Upload ---- */
.photo-upload {
    border: 2px dashed var(--primary);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--background);
    display: block;
    width: 100%;
    color: var(--muted-foreground);
}

.photo-upload:hover {
    border-color: var(--secondary);
    background-color: var(--card);
}

.photo-upload input[type="file"] {
    display: none;
}

.form-group input[type="file"] {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--background);
    color: var(--foreground);
    cursor: pointer;
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: var(--card);
    border: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

/* ---- Submit Button ---- */
.submit-btn {
    background: var(--secondary);
    color: var(--secondary-foreground);
    padding: 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    width: 100%;
    min-height: 56px;
    margin-top: 20px;
}

.submit-btn:hover,
.submit-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Loading Spinner ---- */
.loading {
    display: none;
    text-align: center;
    padding: 30px 20px;
    background: var(--card);
    border-radius: 12px;
    margin-top: 20px;
    color: var(--muted-foreground);
    transition: background-color 0.3s ease;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Success / Error Messages ---- */
.success-message {
    font-size: 1em;
    display: none;
    background: var(--card);
    color: var(--primary);
    padding: 25px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.success-message h3 {
    font-size: 1.3em;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary);
}

.success-message p {
    font-size: 1em;
    line-height: 1.4;
    margin: 0;
    color: var(--foreground);
}

.error-message {
    font-size: 1em;
    display: none;
    background: var(--card);
    color: #ef4444;
    padding: 25px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.error-message h3 {
    font-size: 1.3em;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
    color: #ef4444;
}

.error-message p {
    font-size: 1em;
    line-height: 1.4;
    margin: 0;
    color: var(--foreground);
}

/* ---- RTL Support (Arabic + Dari) ---- */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .language-selector {
    text-align: center;
}

.rtl .change-language-btn {
    margin: 0 auto;
}

/* ---- Responsive: Desktop ---- */
@media (min-width: 769px) {
    .form-content {
        padding: 30px;
        max-width: 800px;
        margin: 0 auto;
    }

    .form-row {
        flex-direction: row;
        gap: 30px;
    }

    .form-group {
        flex: 1;
    }

    .radio-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .checkbox-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .submit-btn {
        width: auto;
        min-width: 300px;
        margin: 20px auto;
        display: block;
    }
}

/* ---- Responsive: Large screens ---- */
@media (min-width: 1024px) {
    .header {
        padding: 40px 30px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .form-content {
        padding: 40px;
    }

    .form-section {
        padding: 30px;
    }
}

/* ---- Responsive: Very small screens ---- */
@media (max-width: 480px) {
    .header {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 0.85em;
    }

    .form-content {
        padding: 10px;
    }

    .form-section {
        padding: 15px 10px;
        margin-bottom: 20px;
    }

    .consent-section {
        padding: 15px 10px;
    }
}
