/* AVV Checker - PLANIT PRIMA Design */
:root {
    --primary: #001489;
    --primary-light: #1a3ab5;
    --secondary: #F0F7FA;
    --accent: #A5F4B2;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #ffffff;
    --bg-muted: #f8fafc;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--secondary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.header p {
    color: var(--text-muted);
    font-size: 15px;
}

.brand {
    margin-bottom: 16px;
    text-align: center;
}

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

/* Language toggle */
.lang-toggle {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    font-size: 23px;
    text-decoration: none;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
    opacity: 0.5;
}

.lang-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
    border-color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
    margin-bottom: 24px;
}

/* Upload form */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--secondary);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--primary);
}

.upload-area h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 14px;
}

.file-name {
    margin-top: 12px;
    font-weight: 600;
    color: var(--primary);
    display: none;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

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

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

.btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover { background: var(--secondary); }

.submit-row {
    margin-top: 24px;
    text-align: center;
}

/* Loading */
.loading {
    text-align: center;
    padding: 48px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* Result page */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: start;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: top;
}

.summary-table td:first-child {
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    width: 180px;
}

/* Donut chart */
.donut-container {
    width: 180px;
    text-align: center;
    flex-shrink: 0;
}

.donut-legend {
    margin-top: 12px;
    font-size: 13px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Detail table */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table th {
    background: var(--primary);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.detail-table tr:nth-child(even) { background: var(--bg-muted); }

.detail-table tr:hover { background: #eef2ff; }

/* Rating badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gruen { background: #dcfce7; color: #166534; }
.badge-gelb { background: #fef9c3; color: #854d0e; }
.badge-rot { background: #fee2e2; color: #991b1b; }

/* Improvement suggestions */
.suggestion {
    margin-top: 8px;
    padding: 10px 12px;
    background: #eff6ff;
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
}

/* Actions bar */
.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* Error */
.error-box {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    color: #991b1b;
    margin-bottom: 24px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.footer .disclaimer {
    text-align: left;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 16px;
    background: var(--bg-muted);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .card { padding: 20px; }
    .summary-grid { grid-template-columns: 1fr; }
    .donut-container { margin: 0 auto; }
    .detail-table { font-size: 12px; }
    .detail-table td, .detail-table th { padding: 8px; }
}

/* iFrame mode - no background */
body.iframe-mode {
    background: transparent;
}

/* Gate page */
.gate-container {
    max-width: 560px;
}

.gate-card {
    padding: 40px 32px;
}

.gate-field {
    margin-bottom: 20px;
}

.gate-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.gate-input:focus {
    border-color: var(--primary);
}

.gate-consent {
    margin-bottom: 24px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.consent-label a {
    color: var(--primary);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    flex-shrink: 0;
}

/* Trust badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.trust-badge svg {
    color: var(--green);
    flex-shrink: 0;
}

/* Limit page */
.limit-card {
    text-align: center;
    padding: 48px 32px;
}

.limit-icon {
    margin-bottom: 20px;
    color: var(--yellow);
}

.limit-card h2 {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 12px;
}

.limit-text {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.limit-price {
    margin-bottom: 28px;
}

.price-tag {
    display: inline-block;
    padding: 8px 20px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.limit-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Exit-intent popup */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.popup-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px 32px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

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

.popup-heading {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 12px;
}

.popup-text {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.popup-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

.popup-dismiss:hover {
    color: var(--text);
}

@media (max-width: 768px) {
    .trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .gate-card {
        padding: 28px 20px;
    }

    .popup-card {
        padding: 28px 20px;
    }
}
