/* CSS Variables for theming */
:root {
    --primary-color: #B51F29;
    --primary-dark: #8a171f;
    --primary-light: #e8d4d6;
    --success-color: #059669;
    --success-light: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --error-color: #dc2626;
    --error-light: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --warning-color: #d97706;
    --text-color: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg-color: #f8fafc;
    --bg-subtle: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 2rem;
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 32px;
    width: auto;
}

.app-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    margin: 0; /* Reset h1 default margin */
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.header-btn-primary {
    background: var(--primary-color);
    color: white;
}

.header-btn-primary:hover {
    background: var(--primary-dark);
}

.header-btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.header-btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-color);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 3rem;
    width: 100%;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-subtle);
}

.dropzone:hover {
    border-color: var(--primary-color);
    background: #fdf8f8;
}

.dropzone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.01);
}

.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.9;
}

.dropzone-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.375rem;
}

.dropzone-subtext {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.dropzone-info {
    color: var(--text-light);
    font-size: 0.8125rem;
    margin-top: 1rem;
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-sm);
}

.file-name {
    font-weight: 600;
    color: var(--text-color);
}

.remove-file {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.remove-file:hover {
    color: var(--error-color);
}

/* Validate Button */
.validate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    margin: 1.5rem auto 0;
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 0.5rem;
}

.validate-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.validate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
}

/* Loading Animation */
.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-container {
    margin-top: 1.5rem;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Quota Info */
.quota-info {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.quota-info strong {
    color: var(--text-color);
    font-weight: 600;
}

/* ==========================================
   RESULTS SECTION - Redesigned
   ========================================== */

.results-section {
    margin-bottom: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Status Card - Hero Section */
.result-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-header.valid {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-bottom-color: var(--success-border);
}

.result-header.invalid,
.result-header.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-bottom-color: var(--error-border);
}

.status-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-header.valid .status-icon-wrapper {
    background: var(--success-color);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.result-header.invalid .status-icon-wrapper,
.result-header.error .status-icon-wrapper {
    background: var(--error-color);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.status-icon-wrapper svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke-width: 3;
}

.status-text-wrapper {
    flex: 1;
}

.result-status {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
    letter-spacing: -0.02em;
}

.result-header.valid .result-status {
    color: var(--success-color);
}

.result-header.invalid .result-status,
.result-header.error .result-status {
    color: var(--error-color);
}

.result-profile {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Validation Hint */
.validation-hint {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: help;
    margin-left: auto;
}

.validation-hint svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    flex-shrink: 0;
}

.validation-hint span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Main Content Grid */
.result-main {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 450px;
}

/* Left Column - Overview */
.result-overview {
    padding: 1.5rem;
    background: var(--bg-subtle);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.overview-content {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.info-row {
    display: flex;
    flex-direction: column;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    gap: 0.25rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.9375rem;
    color: var(--text-color);
    font-weight: 500;
    word-break: break-word;
}

.info-value.status-valid {
    color: var(--success-color);
    font-weight: 700;
}

.info-value.status-invalid {
    color: var(--error-color);
    font-weight: 700;
}

/* Right Column - Invoice */
.result-invoice {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.875rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

.visualization-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.viz-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.viz-select:hover {
    border-color: var(--primary-color);
}

.viz-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(181, 31, 41, 0.1);
}

.json-container {
    flex: 1;
    min-height: 400px;
    overflow: hidden;
}

.json-container .json-content {
    height: 100%;
    min-height: 400px;
    margin: 0;
    border-radius: var(--radius-sm);
}

/* Control Buttons (New Window, PDF Download) */
.control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-muted);
}

.control-btn:hover {
    background: var(--bg-subtle);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

/* iFrame Container */
.iframe-container {
    flex: 1;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: white;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================
   DETAILS SECTION - Tabs Redesigned
   ========================================== */

.result-details {
    border-top: 1px solid var(--border-color);
}

.result-details summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: background 0.15s;
    user-select: none;
}

.result-details summary:hover {
    background: var(--border-light);
}

.result-details summary::-webkit-details-marker {
    display: none;
}

.result-details summary::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid var(--text-muted);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.2s;
}

.result-details[open] summary::before {
    transform: rotate(90deg);
}

.details-content {
    background: var(--card-bg);
}

/* Tabs - Redesigned */
.tabs {
    display: flex;
    gap: 0.25rem;
    padding: 1rem 1.5rem 0;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
}

.tab {
    position: relative;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text-color);
    background: rgba(255,255,255,0.5);
}

.tab.active {
    color: var(--primary-color);
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Tab Content */
.tab-content {
    padding: 1.5rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.iframe-container-small {
    height: 450px;
    min-height: auto;
}

/* JSON Content */
.json-content {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    overflow: auto;
    max-height: 500px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.8125rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==========================================
   PROMO SECTION - Belegpostfach
   ========================================== */

.promo-section {
    margin-bottom: 2rem;
}

.promo-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    text-align: center;
}

.promo-header {
    margin-bottom: 2rem;
}

.promo-logo {
    height: 48px;
    width: auto;
    margin-bottom: 0.5rem;
}

.promo-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1rem;
}

.promo-badge {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.promo-subtitle {
    font-size: 1.0625rem;
    color: var(--text-muted);
    font-weight: 500;
}

.promo-features {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.promo-feature {
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.promo-feature:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.875rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fce4e6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.promo-feature h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.375rem;
}

.promo-feature p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.promo-footnote {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.promo-footnote sup {
    color: var(--primary-color);
}

.promo-cta {
    margin-top: 0;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.promo-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.promo-btn svg {
    width: 20px;
    height: 20px;
}

.promo-enterprise {
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.promo-enterprise a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.promo-enterprise a:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .promo-features {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .promo-container {
        padding: 1.5rem;
    }

    .promo-badges {
        gap: 1rem;
    }

    .promo-badge {
        height: 48px;
    }

    .promo-title {
        font-size: 1.375rem;
    }

    .promo-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .promo-feature {
        padding: 1rem 0.5rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
    }

    .feature-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .promo-features {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   OEM / INTEGRATOREN SECTION
   ========================================== */

.oem-section {
    margin-bottom: 2rem;
}

.oem-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    text-align: center;
    color: white;
}

.oem-header {
    margin-bottom: 2rem;
}

.oem-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.oem-subtitle {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
}

.oem-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.oem-product {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: left;
    transition: all 0.2s ease;
}

.oem-product:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.oem-product-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.oem-product-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.oem-product h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.oem-product p {
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.oem-info {
    margin-bottom: 1.5rem;
}

.oem-info p {
    font-size: 0.9375rem;
    color: #94a3b8;
    font-style: italic;
}

.oem-contact {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.oem-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
}

.oem-contact-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.oem-contact-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .oem-container {
        padding: 1.5rem;
    }

    .oem-title {
        font-size: 1.25rem;
    }

    .oem-products {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .oem-product {
        padding: 1.25rem;
    }

    .oem-contact {
        flex-direction: column;
        gap: 0.75rem;
    }

    .oem-contact-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Footer API Link */
.footer-api-link {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.footer-api-link:hover {
    text-decoration: underline;
}

/* ==========================================
   DISCLAIMER SECTION
   ========================================== */

.disclaimer-section {
    margin-bottom: 2rem;
}

.disclaimer {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.disclaimer summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer summary::-webkit-details-marker {
    display: none;
}

.disclaimer summary::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid var(--text-light);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.2s;
}

.disclaimer[open] summary::before {
    transform: rotate(90deg);
}

.disclaimer-content {
    padding: 0 1.5rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.disclaimer-content h4 {
    color: var(--text-secondary);
    margin: 1rem 0 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.disclaimer-content h4:first-child {
    margin-top: 0;
}

.disclaimer-content p {
    margin-bottom: 0.375rem;
}

.opensource-list {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.opensource-list li {
    margin-bottom: 0.375rem;
}

.opensource-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.opensource-list a:hover {
    text-decoration: underline;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-info {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .result-main {
        grid-template-columns: 1fr;
    }

    .result-overview {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .iframe-container {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .app-title {
        font-size: 1rem;
        text-align: center;
    }

    .header-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 1rem;
    }

    .upload-container {
        padding: 1.25rem;
    }

    .dropzone {
        padding: 2rem 1rem;
    }

    .result-header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .result-status {
        font-size: 1.25rem;
    }

    .result-overview,
    .result-invoice {
        padding: 1.25rem;
    }

    .tabs {
        padding: 0.75rem 1rem 0;
        gap: 0.125rem;
    }

    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .section-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .iframe-container,
    .iframe-container-small {
        height: 300px;
        min-height: auto;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.error-message {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.9375rem;
}

/* ==========================================
   RESULT PROMO MODAL
   ========================================== */

.result-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.result-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
    width: 100%;
    padding: 1.75rem;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

.result-modal-status {
    margin-bottom: 1.25rem;
}

.result-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-modal-icon.valid {
    background: var(--success-color);
}

.result-modal-icon.invalid {
    background: var(--error-color);
}

.result-modal-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.result-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
}

.result-modal-hint {
    font-size: 0.6875rem;
    color: var(--text-light);
    margin-top: 0.375rem;
    font-weight: 400;
}

.result-modal-btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 1rem;
}

.result-modal-btn-primary:hover {
    background: var(--primary-dark);
}

.result-modal-promo {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.result-modal-logo {
    height: 32px;
    width: auto;
    margin-bottom: 0.75rem;
}

.result-modal-slogan {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.875rem;
    line-height: 1.5;
}

.result-modal-trial {
    margin-bottom: 1rem;
}

.result-modal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg-subtle);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.15s ease;
    margin-bottom: 0.625rem;
}

.result-modal-cta-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.result-modal-cta-btn svg {
    width: 14px;
    height: 14px;
}

.result-modal-oem-link {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
}

.result-modal-oem-link:hover {
    color: var(--primary-color);
}

/* ==========================================
   QUOTA LIMIT MODAL
   ========================================== */

.quota-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.quota-modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.quota-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.15s;
}

.quota-modal-close:hover {
    color: var(--text-color);
}

.quota-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: var(--error-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quota-modal-icon svg {
    width: 32px;
    height: 32px;
    color: var(--error-color);
}

.quota-modal-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.quota-modal-text {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.quota-modal-promo {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.quota-modal-logo {
    height: 36px;
    width: auto;
    margin-bottom: 0.875rem;
}

.quota-modal-slogan {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.quota-modal-trial {
    margin-bottom: 1.25rem;
}

.trial-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--success-color) 0%, #10b981 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.quota-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.15s ease;
    margin-bottom: 0.875rem;
}

.quota-modal-btn:hover {
    background: var(--primary-dark);
}

.quota-modal-btn svg {
    width: 20px;
    height: 20px;
}

.quota-modal-login {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
}

.quota-modal-login:hover {
    color: var(--primary-color);
}

.quota-modal-oem-link {
    display: block;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
}

.quota-modal-oem-link:hover {
    color: var(--primary-color);
}
