/* --- Стили для Квадрата Пифагора (Indigo Theme 2026) --- */
:root {
    --accent-pythagoras: #6366F1;
    --accent-pythagoras-dark: #3730A3;
    --accent-pythagoras-light: #E0E7FF;
    --gradient-pythagoras-card: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Сетка */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.1fr 0.9fr; } }

/* Inputs */
.calc-inputs { gap: 16px; }

/* Test Intro */
.test-intro {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 2px solid #C7D2FE;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.intro-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
}

.test-intro h3 {
    text-align: center;
    color: var(--accent-pythagoras-dark);
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
}

.test-intro p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.intro-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.intro-list li {
    padding: 6px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.intro-note {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid #6366F1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--accent-pythagoras-dark);
}

/* Divider */
.divider {
    border-top: 1px solid #E5E7EB;
    margin: 24px 0;
}

/* Form */
.pythagoras-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.label-icon { font-size: 16px; }

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.form-input:focus {
    border-color: var(--accent-pythagoras);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.helper-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-pythagoras-card);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    margin-top: 8px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* Результаты (Pythagoras Card) */
.card--pythagoras {
    background: var(--gradient-pythagoras-card);
    color: #fff;
    border: none;
}

.card--pythagoras h2 {
    color: rgba(255,255,255,0.95);
    margin-bottom: 20px;
    font-size: 16px;
}

.card--pythagoras-placeholder {
    background: #F9FAFB;
    border: 2px dashed #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.placeholder-content {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

@media (min-width: 900px) {
    .sticky-card {
        position: sticky;
        top: 24px;
    }
}

/* Matrix Container */
.matrix-container {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.matrix-cell {
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    overflow: hidden;
}

.cell-digit {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.1;
    letter-spacing: 2px;
}

.cell-count {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    margin-top: 4px;
}

.matrix-labels {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.label-row span {
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

/* Numbers Row */
.numbers-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.number-box {
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.number-label {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    display: block;
    margin-bottom: 6px;
}

.number-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

/* Summary Divider */
.summary-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 24px 0;
}

/* Details List */
.details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 10px;
    font-size: 14px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

/* Karmic Box */
.karmic-box {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.karmic-box h4 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.karmic-box ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    line-height: 1.7;
}

.karmic-box li {
    margin-bottom: 6px;
}

/* Recommendation Box */
.recommendation-box {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

.rec-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.rec-text {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.95);
}

/* Compatibility Box */
.compatibility-box {
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.compatibility-box h4 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.compat-percent {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.compat-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}

/* ============================================ */
/* INFO WRAPPER - SEO Content                   */
/* ============================================ */
.info-wrapper {
    padding: 60px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.info-wrapper .container {
    max-width: 900px;
    margin: 0 auto;
}

/* Icon Heading */
.icon-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
    margin-top: -4px;
}

.header-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
}

.indigo-icon svg { color: #6366F1; }
.blue-icon svg { color: #0284C7; }
.orange-icon svg { color: #EA580C; }

.intro-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

/* Calculation Grid */
.calculation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.calc-step {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.calc-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.step-num {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    background: var(--gradient-pythagoras-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.calc-step h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.calc-step p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Soft Divider */
.soft-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 48px 0;
}

/* Matrix Legend */
.matrix-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.legend-item {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    padding: 14px 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 70px;
}

.legend-digit {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--gradient-pythagoras-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.legend-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 70px;
    line-height: 1.2;
}

.legend-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Calc Description */
.calc-description p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.calc-description strong {
    color: var(--text-primary);
}

/* FAQ */
.faq-section .faq-item {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.faq-section .faq-item[open] {
    border-color: var(--accent-pythagoras);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

summary.faq-question {
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

summary.faq-question:hover {
    background: #F9FAFB;
}

.faq-section .faq-item[open] summary.faq-question {
    color: var(--accent-pythagoras-dark);
    background: var(--accent-pythagoras-light);
}

.faq-question::after {
    content: '+';
    font-size: 22px;
    color: var(--text-secondary);
    font-weight: 400;
    transition: all 0.2s;
}

.faq-section .faq-item[open] summary.faq-question::after {
    content: '−';
    color: var(--accent-pythagoras-dark);
}

.faq-answer {
    padding: 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
    border-top: 1px solid #F1F5F9;
}

.faq-answer p {
    margin: 0;
}

/* ============================================ */
/* Mobile Responsive                            */
/* ============================================ */
@media (max-width: 900px) {
    .numbers-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .calculation-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .matrix-legend {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .info-wrapper {
        padding: 40px 0;
        margin-top: 40px;
    }

    .matrix-container {
        padding: 16px;
    }

    .matrix-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .matrix-cell {
        padding: 8px 4px;
        min-height: 70px;
    }

    .cell-digit {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .cell-count {
        font-size: 9px;
    }

    .numbers-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .number-box {
        padding: 10px;
    }

    .number-value {
        font-size: 16px;
    }

    .calculation-grid {
        grid-template-columns: 1fr;
    }
}
