/* ============================================================
   ai-diagnostic-quiz.css — Style panelu diagnostycznego AB-GROUP
   Reużywalne na ai-diagnostic.html i b2b.html
   ============================================================ */

/* --- Zmienne lokalne (fallback jeśli strona nie definiuje root) --- */
:root {
    --bg-dark: #0a0e17;
    --bg-deeper: #05080f;
    --bg-card: #141b2d;
    --text-main: #f0f6fc;
    --text-muted: #9aa5b4;
    --accent-gold: #c9a84c;
    --accent-orange: #e37e33;
    --accent-blue: #0ea5e9;
    --line-soft: rgba(255,255,255,0.08);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* --- Utility classes --- */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.gap-3 { gap: 0.75rem; }
.hidden { display: none !important; }

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
}

/* --- Tryb wyboru testu --- */
.test-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 1.2rem 0 1.3rem;
}

.mode-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.78rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(5,8,15,0.38);
    color: var(--text-main);
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
    font-family: var(--font-body);
}

.mode-card:hover {
    transform: translateY(-2px);
    border-color: rgba(201,168,76,0.42);
    background: rgba(201,168,76,0.08);
}

.mode-card i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffe7a8;
    border: 1px solid rgba(201,168,76,0.28);
    background: rgba(201,168,76,0.08);
}

.mode-card strong {
    display: block;
    color: #fff;
    font-size: 1rem;
}

.mode-card span {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

/* --- Formularz profilu firmy --- */
.profile-form {
    display: grid;
    gap: 0.9rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.field select,
.field textarea {
    min-height: 48px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(5,8,15,0.56);
    color: #fff;
    padding: 0.82rem 0.9rem;
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 88px;
    resize: vertical;
}

.field select:focus,
.field textarea:focus {
    border-color: rgba(14,165,233,0.68);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

/* --- Panel diagnostyczny --- */
.diagnostic-panel {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(20,27,45,0.9), rgba(8,12,22,0.96)),
        rgba(20,27,45,0.92);
    box-shadow:
        0 30px 80px rgba(0,0,0,0.42),
        inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(5,8,15,0.42);
}

.tool-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #bdeaff;
    background: rgba(14,165,233,0.12);
    border: 1px solid rgba(14,165,233,0.28);
}

.tool-title strong {
    display: block;
    color: #fff;
    font-size: 1rem;
}

.tool-title span {
    display: block;
    margin-top: 0.16rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 34px;
    border: 1px solid rgba(16,185,129,0.32);
    border-radius: 999px;
    padding: 0.45rem 0.72rem;
    background: rgba(16,185,129,0.09);
    color: #a7f3d0;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.tool-body {
    padding: clamp(1.1rem, 3vw, 2rem);
}

/* --- Sekcja intro panelu --- */
.intro-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1.2rem 0 1.4rem;
}

.intro-metric {
    min-height: 98px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(5,8,15,0.38);
    padding: 0.9rem;
}

.intro-metric i {
    color: var(--accent-gold);
    margin-bottom: 0.6rem;
}

.intro-metric strong {
    display: block;
    color: #fff;
    font-size: 0.96rem;
}

.intro-metric span {
    display: block;
    margin-top: 0.24rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.quiet-copy {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* --- Sekcja pytania --- */
.question-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.question-index {
    color: var(--accent-gold);
    font-weight: 900;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.question-title {
    margin-top: 0.32rem;
    color: #fff;
    font-size: clamp(1.28rem, 2vw, 1.8rem);
    line-height: 1.35;
    font-weight: 800;
}

.dont-know-meter {
    flex: 0 0 auto;
    min-width: 130px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.dont-know-meter strong {
    display: block;
    color: #ffd98c;
    font-size: 1rem;
    margin-top: 0.18rem;
}

.answer-hint {
    display: none;
    margin: -0.15rem 0 0.9rem;
    color: #bdeaff;
    font-size: 0.82rem;
    font-weight: 800;
}

.answer-hint.visible {
    display: flex;
    align-items: center;
    gap: 0.52rem;
}

/* --- Insight banner --- */
.insight-banner {
    display: none;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 0 0 1rem;
    border: 1px solid rgba(201,168,76,0.26);
    border-radius: 8px;
    background: rgba(201,168,76,0.08);
    color: #f8e7b1;
    padding: 0.86rem;
    font-size: 0.86rem;
    line-height: 1.55;
}

.insight-banner.visible {
    display: flex;
}

/* --- Opcje odpowiedzi --- */
.options-grid {
    display: grid;
    gap: 0.72rem;
}

.option-btn {
    width: 100%;
    min-height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(5,8,15,0.42);
    color: #eef4fb;
    padding: 0.92rem 1rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.option-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(201,168,76,0.38);
    background: rgba(201,168,76,0.08);
}

.option-btn.selected {
    border-color: rgba(14,165,233,0.75);
    background: rgba(14,165,233,0.13);
}

.option-btn .check {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #07111d;
    font-size: 0.66rem;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.option-btn.selected .check {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* --- Stopka narzędzia --- */
.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.2rem;
}

.tool-btn {
    min-height: 46px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border: 0;
    font-weight: 800;
    font-family: var(--font-body);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.tool-btn.primary {
    background: linear-gradient(135deg, var(--accent-gold), #9f7d2e);
    color: #070a10;
    box-shadow: 0 16px 36px rgba(201,168,76,0.16);
    border: 1px solid transparent;
}

.tool-btn.secondary {
    background: rgba(20,27,45,0.72);
    color: #e7eef8;
    border: 1px solid rgba(255,255,255,0.1);
}

.tool-btn:hover {
    transform: translateY(-2px);
}

.tool-btn.secondary:hover {
    border-color: rgba(14,165,233,0.42);
    color: #bdeaff;
}

.tool-btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
    box-shadow: none;
}

.micro-status {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- Formularz lead (e-mail) --- */
.lead-form {
    display: grid;
    gap: 0.9rem;
    max-width: 520px;
}

.field {
    display: grid;
    gap: 0.36rem;
}

.field label {
    color: #dbe5f2;
    font-size: 0.86rem;
    font-weight: 700;
}

.field input[type="email"],
.field input[type="text"] {
    min-height: 48px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(5,8,15,0.56);
    color: #fff;
    padding: 0.82rem 0.9rem;
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
    border-color: rgba(14,165,233,0.68);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

.consent-line {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.55;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.85rem;
    background: rgba(5,8,15,0.28);
}

.consent-line input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
    margin-top: 0.15rem;
}

/* --- Sekcja wyników --- */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    align-items: start;
}

.result-summary {
    display: grid;
    gap: 0.82rem;
}

.result-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    border: 1px solid rgba(201,168,76,0.36);
    border-radius: 999px;
    background: rgba(201,168,76,0.11);
    color: #ffe7a8;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 900;
}

.result-title {
    color: #fff;
    font-size: clamp(1.65rem, 2.4vw, 2.15rem);
    font-family: var(--font-heading);
    line-height: 1.12;
    margin: 0;
}

.result-desc {
    color: #c8d1df;
    line-height: 1.72;
    margin: 0;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    margin: 0.45rem 0;
}

.stat-box {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(5,8,15,0.38);
    padding: 0.86rem;
}

.stat-box span {
    color: var(--text-muted);
    display: block;
    font-size: 0.76rem;
}

.stat-box strong {
    display: block;
    margin-top: 0.25rem;
    color: #fff;
    font-size: 1.02rem;
}

.offer-box {
    border: 1px solid rgba(14,165,233,0.28);
    border-radius: 8px;
    background: rgba(14,165,233,0.09);
    padding: 1rem;
}

.offer-box span {
    display: block;
    color: #a7e3ff;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.offer-box strong {
    display: block;
    margin-top: 0.3rem;
    color: #fff;
    font-size: 1.35rem;
}

.offer-box p {
    color: #cbd8e8;
    line-height: 1.62;
    margin: 0.5rem 0 0;
    font-size: 0.92rem;
}

/* --- Wykresy --- */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.chart-panel {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(5,8,15,0.36);
    padding: 1rem;
}

.chart-panel h4 {
    margin: 0 0 0.75rem;
    color: #fff;
    font-size: 0.92rem;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 225px;
}

/* --- Responsywność panelu --- */
@media (max-width: 760px) {
    .test-mode-grid,
    .profile-grid,
    .intro-grid,
    .result-stats {
        grid-template-columns: 1fr;
    }

    .question-top,
    .tool-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .dont-know-meter {
        min-width: 0;
        text-align: left;
    }

    .tool-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-container {
        height: 235px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}
