/* ═══════════════════════════════════════════════════════════════
   BIZ Sichtbarkeitscheck — Stylesheet
   CI: #70b62c (Gruen), #f39c12 (Gelb), #e74c3c (Rot)
   Font: Roboto
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --green: #70b62c;
    --green-dark: #5a9423;
    --green-light: #e8f5d6;
    --yellow: #f39c12;
    --yellow-light: #fef9e7;
    --red: #e74c3c;
    --red-light: #fdedec;
    --blue: #3498db;
    --blue-light: #eaf6fd;
    --purple: #9b59b6;
    --purple-light: #f4ecf7;
    --text: #1a1a1a;
    --text-muted: #666666;
    --bg: #f5f5f5;
    --bg-white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

body {
    font-family: 'Roboto', Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────────────────── */

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

.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}

/* ─── Header ─────────────────────────────────────────────────── */

.header {
    text-align: center;
    padding: 40px 20px 20px;
}

.header img {
    height: 48px;
    margin-bottom: 16px;
}

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

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

/* ─── Eingabe-Formular ───────────────────────────────────────── */

.input-section {
    text-align: center;
    padding: 40px 20px;
}

.input-group {
    display: flex;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto 16px;
}

.input-group input {
    flex: 1;
    padding: 14px 20px;
    font-size: 1.05rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--green);
}

.optional-fields {
    display: flex;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto 16px;
}

.optional-fields input {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.optional-fields input:focus {
    border-color: var(--green);
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: help;
    flex-shrink: 0;
    position: relative;
    align-self: center;
}

.info-icon:hover {
    background: var(--blue-light);
    color: var(--blue);
}

/* Tooltip */
.info-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    width: 280px;
    text-align: left;
    z-index: 10;
    pointer-events: none;
}

.info-icon:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text);
    z-index: 10;
}

.btn-primary {
    background: var(--green);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ─── Loading ────────────────────────────────────────────────── */

.loading-section {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.loading-section.active { display: block; }

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.loading-steps {
    list-style: none;
    max-width: 320px;
    margin: 0 auto;
    text-align: left;
}

.loading-steps li {
    padding: 8px 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.loading-steps li.done { color: var(--green); font-weight: 500; }
.loading-steps li.active { color: var(--text); font-weight: 500; }

.loading-steps li::before {
    content: '○';
    font-size: 1.1rem;
}
.loading-steps li.done::before { content: '✓'; color: var(--green); }
.loading-steps li.active::before { content: '◉'; color: var(--green); }

/* ─── Scorecard ──────────────────────────────────────────────── */

.scorecard {
    display: none;
}

.scorecard.active { display: block; }

.score-header {
    text-align: center;
    margin-bottom: 24px;
}

.score-header h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    position: relative;
}

.score-circle.good { background: var(--green); }
.score-circle.yellow { background: var(--yellow); }
.score-circle.red { background: var(--red); }

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.score-tile {
    background: var(--bg);
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.score-tile .icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
}
.score-tile .label { font-size: 0.78rem; font-weight: 600; }

.score-tile.good { background: var(--green); border-color: var(--green); }
.score-tile.good .label { color: white; }
.score-tile.yellow { background: var(--yellow); border-color: var(--yellow); }
.score-tile.yellow .label { color: white; }
.score-tile.red { background: var(--red); border-color: var(--red); }
.score-tile.red .label { color: white; }
.score-tile.unknown { background: var(--bg); border-color: var(--border); }
.score-tile.unknown .label { color: var(--text-muted); }

.score-summary {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.score-summary .good { color: var(--green); }
.score-summary .yellow { color: var(--yellow); }
.score-summary .red { color: var(--red); }

/* ─── Sektionen ──────────────────────────────────────────────── */

.section {
    display: none;
    margin-bottom: 24px;
}

.section.active { display: block; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
}

.section-header .badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.badge.good { background: var(--green); }
.badge.yellow { background: var(--yellow); }
.badge.red { background: var(--red); }
.badge.unknown { background: #999; }

.section-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Kontext-Box (Warum ist das wichtig?) */
.context-box {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.context-box strong {
    color: var(--text);
}

/* Toggle-Checkliste */
.checklist li {
    cursor: pointer;
    transition: background 0.15s;
}

.checklist li:hover {
    background: var(--bg);
    border-radius: 6px;
}

.check-detail {
    display: none;
    width: 100%;
    padding: 8px 0 4px 36px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.checklist li.open .check-detail {
    display: block;
}

.check-toggle {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.checklist li.open .check-toggle {
    transform: rotate(180deg);
}

/* Tech Checkliste */
.checklist {
    list-style: none;
}

.checklist li {
    padding: 10px 0;
    border-bottom: 1px solid var(--bg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
}

.checklist li:last-child { border-bottom: none; }

.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.check-icon.pass { background: var(--green); }
.check-icon.fail { background: var(--red); }
.check-icon.warn { background: var(--yellow); }

/* Performance Kreise */
.perf-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.perf-circle {
    text-align: center;
}

.perf-circle .circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.3rem;
    font-weight: 700;
    border: 4px solid var(--border);
}

.perf-circle .circle.good { border-color: var(--green); color: var(--green); }
.perf-circle .circle.yellow { border-color: var(--yellow); color: var(--yellow); }
.perf-circle .circle.red { border-color: var(--red); color: var(--red); }

.perf-circle .label { font-size: 0.75rem; color: var(--text-muted); }

/* Vitals Tabelle */
.vitals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.vitals-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg);
    font-weight: 500;
    border-radius: 4px;
}

.vitals-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg);
}

/* Kacheln (Visibility, Backlinks) */
.metric-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.metric-tile {
    background: var(--bg);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.metric-tile .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--green-dark);
}

.metric-tile .label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Keywords Tabelle */
.keywords-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.keywords-table th {
    text-align: left;
    padding: 10px 8px;
    background: var(--green-dark);
    color: white;
    font-weight: 500;
}

.keywords-table th:first-child { border-radius: 6px 0 0 0; }
.keywords-table th:last-child { border-radius: 0 6px 0 0; }

.keywords-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--bg);
}

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

/* ─── E-Mail Gate ────────────────────────────────────────────── */

.email-gate {
    display: none;
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--green-light), white);
    border: 2px solid var(--green);
}

.email-gate.active { display: block; }

.email-gate h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.email-gate p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.gate-form {
    max-width: 400px;
    margin: 0 auto;
}

.gate-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}

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

.gate-form .checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    text-align: left;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.gate-form .checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-top: 2px;
}

.locked-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
}

/* ─── KI-Sektion (Lila-Theme) ────────────────────────────────── */

.section.ai-section .section-header {
    border-bottom-color: var(--purple-light);
}

.section.ai-section .badge { background: var(--purple); }

/* ─── Quick-Wins ─────────────────────────────────────────────── */

.quickwins-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.quickwins-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--green-dark);
    color: white;
}

.quickwins-table td {
    padding: 12px;
    border-bottom: 1px solid var(--bg);
}

.effort-badge, .impact-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.effort-badge.low { background: var(--green-light); color: var(--green-dark); }
.effort-badge.medium { background: var(--yellow-light); color: #856404; }
.effort-badge.high { background: var(--red-light); color: var(--red); }

.impact-badge.high { background: var(--green-light); color: var(--green-dark); }
.impact-badge.medium { background: var(--yellow-light); color: #856404; }
.impact-badge.low { background: var(--red-light); color: var(--red); }

/* ─── CTA Box ────────────────────────────────────────────────── */

.cta-box {
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--green-light), white);
    border: 2px solid var(--green);
    border-radius: var(--radius);
    margin-top: 32px;
}

.cta-box h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.cta-box p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ─── Tip Box ────────────────────────────────────────────────── */

.tip-box {
    background: var(--green-light);
    border-left: 4px solid var(--green);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
    font-size: 0.9rem;
}

.tip-box strong { color: var(--green-dark); }

.info-box {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
    font-size: 0.9rem;
}

.warn-box {
    background: var(--yellow-light);
    border-left: 4px solid var(--yellow);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
    font-size: 0.9rem;
}

/* ─── Error ──────────────────────────────────────────────────── */

.error-message {
    display: none;
    text-align: center;
    padding: 24px;
    background: var(--red-light);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    color: var(--red);
}

.error-message.active { display: block; }

/* ─── Footer ─────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer a { color: var(--green); text-decoration: none; }

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .container { padding: 12px; }
    .card { padding: 20px 16px; }
    .header h1 { font-size: 1.4rem; }

    .input-group {
        flex-direction: column;
    }

    .optional-fields {
        flex-direction: column;
    }

    .score-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .perf-scores {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .keywords-table, .quickwins-table {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 { font-size: 1.2rem; }
    .score-circle { width: 90px; height: 90px; font-size: 1.8rem; }
    .score-summary { flex-direction: column; gap: 8px; }
}
