/* calc/assets/css/calculators/matrix-of-destiny.css */

:root {
    --mod-primary: #7C3AED; /* Фиолетовый / Аметист */
    --mod-bg: #F5F3FF;      /* Светло-пурпурный */
    --mod-dark: #4C1D95;    /* Глубокий фиолетовый */
    --mod-gold: #F59E0B;    /* Золото для акцентов */
}

/* --- ВЕРХНЯЯ ЧАСТЬ --- */
.calc-header { margin-bottom: 40px; }
.subtitle { color: var(--text-secondary); margin-top: 12px; font-size: 16px; line-height: 1.5; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 992px) { .calc-grid { grid-template-columns: 1fr 1.2fr; gap: 48px; } }

.form-divider { border: none; height: 1px; background: #EDE9FE; margin: 24px 0; opacity: 0.7; }

/* Инпуты */
.input-group { margin-bottom: 24px; }
.label-with-icon { display: flex; align-items: center; gap: 8px; color: var(--mod-primary) !important; font-size: 16px !important; font-weight: 700 !important; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input {
    width: 100%; padding: 14px 16px;
    font-size: 18px; font-weight: 700; font-family: inherit;
    border: 1px solid #D1D5DB; border-radius: 12px;
    transition: all 0.2s; outline: none; background: #fff;
    color: #1F2937;
}
.input-wrapper input:focus { border-color: var(--mod-primary); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15); }
.helper-text { font-size: 13px; color: #6B7280; margin-top: 8px; line-height: 1.4; }
.highlight-group { background: var(--mod-bg); padding: 24px; border-radius: 16px; border: 1px dashed var(--mod-primary); }

/* Заглушка-инструкция */
.mystic-intro { margin-top: 32px; padding: 24px; background: #fff; border-radius: 16px; border: 1px solid #E5E7EB; box-shadow: var(--shadow-soft); text-align: center; }
.mi-icon { font-size: 32px; color: var(--mod-gold); margin-bottom: 12px; }
.mystic-intro h3 { font-size: 16px; color: var(--mod-dark); margin: 0 0 16px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.mystic-intro ul { list-style: none; padding: 0; margin: 0; text-align: left; }
.mystic-intro li { font-size: 14px; color: #4B5563; margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }

/* --- ПРАВАЯ ЧАСТЬ: РЕЗУЛЬТАТ (KILLER FEATURE) --- */
.destiny-result-card { background: #fff; border: 2px solid var(--mod-bg); padding: 32px; overflow: hidden; position: relative; }
@media (min-width: 992px) { .sticky-card { position: sticky; top: 24px; transition: top 0.3s; } }

/* Фон с мандалой/узором */
.destiny-result-card::before {
    content: ''; position: absolute; top: -50px; right: -50px; width: 250px; height: 250px;
    background: radial-gradient(circle, var(--mod-bg) 0%, transparent 70%);
    border-radius: 50%; opacity: 0.8; pointer-events: none;
}

.result-header { text-align: center; margin-bottom: 32px; position: relative; z-index: 2; }
.result-header h2 { font-size: 20px; font-weight: 800; color: var(--mod-dark); margin: 0 0 4px 0; text-transform: uppercase; letter-spacing: 1px; }
.result-header p { margin: 0; color: #6B7280; font-size: 14px; }

/* КАНВАС МАТРИЦЫ */
.matrix-canvas {
    position: relative; width: 260px; height: 260px; margin: 0 auto 40px auto;
    background: #fff; border-radius: 50%; box-shadow: 0 10px 30px rgba(124, 58, 237, 0.1);
    border: 1px solid #EDE9FE; z-index: 2;
}

/* Линии */
.m-line { position: absolute; background: #DDD6FE; z-index: 1; }
.line-h { top: 50%; left: 10%; right: 10%; height: 2px; transform: translateY(-50%); }
.line-v { left: 50%; top: 10%; bottom: 10%; width: 2px; transform: translateX(-50%); }
.line-d1 { top: 50%; left: 15%; right: 15%; height: 1px; transform: translateY(-50%) rotate(45deg); background: dashed #DDD6FE; border-top: 2px dashed #C4B5FD; background: transparent; }
.line-d2 { top: 50%; left: 15%; right: 15%; height: 1px; transform: translateY(-50%) rotate(-45deg); border-top: 2px dashed #C4B5FD; background: transparent; }

/* Точки */
.m-point {
    position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 48px; height: 48px; background: #fff; border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: transform 0.3s;
}
.m-point:hover { transform: scale(1.1); }
.m-val { font-size: 20px; font-weight: 800; color: var(--mod-primary); line-height: 1; }
.m-label { position: absolute; bottom: -20px; font-size: 10px; font-weight: 700; color: #6B7280; text-transform: uppercase; white-space: nowrap; }

.point-center { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border: 2px solid var(--mod-gold); }
.point-center:hover { transform: translate(-50%, -50%) scale(1.1); }
.point-center .m-val { color: var(--mod-gold); font-size: 24px; }

.point-left { top: 50%; left: 0; transform: translate(-50%, -50%); border: 2px solid var(--mod-primary); }
.point-left:hover { transform: translate(-50%, -50%) scale(1.1); }
.point-top { top: 0; left: 50%; transform: translate(-50%, -50%); border: 2px solid #8B5CF6; }
.point-top:hover { transform: translate(-50%, -50%) scale(1.1); }
.point-right { top: 50%; right: 0; transform: translate(50%, -50%); border: 2px solid #8B5CF6; }
.point-right:hover { transform: translate(50%, -50%) scale(1.1); }
.point-bottom { bottom: 0; left: 50%; transform: translate(-50%, 50%); border: 2px solid #EF4444; }
.point-bottom:hover { transform: translate(-50%, 50%) scale(1.1); }
.point-bottom .m-val { color: #EF4444; }

/* Расшифровка */
.decoding-list { display: flex; flex-direction: column; gap: 16px; }
.decode-item { background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 16px; padding: 20px; transition: all 0.2s; }
.decode-item:hover { background: #fff; box-shadow: var(--shadow-soft); border-color: var(--mod-bg); }

.di-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.di-badge { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff; }
.di-header h3 { font-size: 16px; font-weight: 800; color: #111827; margin: 0; }
.di-subtitle { font-size: 12px; color: #6B7280; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; padding-left: 40px; }
.di-text { font-size: 14px; color: #4B5563; line-height: 1.5; margin: 0; padding-left: 40px; }

.bg-primary { background: var(--mod-primary); }
.bg-danger { background: #EF4444; }
.bg-success { background: var(--mod-gold); }


/* --- НИЖНЯЯ ЧАСТЬ (SEO, INFO) --- */
.info-wrapper { padding: 80px 0; margin-top: 60px; border-top: 1px solid #E5E7EB; }

.author-badge { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 40px; padding: 20px; background: #F8FAFC; border-radius: 16px; border: 1px solid #E2E8F0; }
.author-avatar { width: 48px; height: 48px; background: var(--mod-dark); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.author-info { display: flex; flex-direction: column; min-width: 0; }
.author-name { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.4; margin-bottom: 4px; }
.author-date { font-size: 13px; color: #6B7280; }

.icon-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 32px; font-size: 26px; font-weight: 800; color: #111827; line-height: 1.25; letter-spacing: -0.02em; }
.header-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); flex-shrink: 0; margin-top: -6px; font-size: 26px; }

.purple-icon { color: var(--mod-primary); }
.dark-icon { color: var(--mod-dark); }
.text-danger { color: #EF4444; }
.text-success { color: #10B981; }

.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 56px; }
.formula-card { background: #fff; border: 1px solid rgba(0,0,0,0.04); box-shadow: 0 4px 20px rgba(0,0,0,0.03); border-radius: 24px; padding: 32px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; flex-direction: column; }
.formula-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(124, 58, 237, 0.1); border-color: rgba(124, 58, 237, 0.1); }
.formula-header { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.formula-card h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

.badge-purple { background: var(--mod-primary); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }
.badge-dark { background: var(--mod-dark); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }

.formula-card p { font-size: 15px; color: var(--text-secondary); margin: 0; line-height: 1.6; font-weight: 500; }
.math-expression { background: var(--mod-bg); border: 1px dashed var(--mod-primary); padding: 18px; border-radius: 14px; font-weight: 700; color: var(--mod-dark); text-align: center; margin-bottom: 20px; font-size: 17px; font-family: 'Courier New', Courier, monospace; letter-spacing: 0.5px; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 56px 0; opacity: 0.7; }
.intro-text { font-size: 16px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; }
.calc-description p { font-size: 17px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 24px; }
.calc-description strong { color: var(--text-primary); font-weight: 700; }

.seo-table-wrapper { overflow-x: auto; margin-bottom: 48px; background: #fff; border-radius: 16px; border: 1px solid #E5E7EB; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.seo-table { width: 100%; border-collapse: collapse; min-width: 500px; text-align: left; }
.seo-table th { background: #F9FAFB; padding: 18px 24px; font-size: 13px; font-weight: 800; color: #6B7280; text-transform: uppercase; border-bottom: 1px solid #E5E7EB; letter-spacing: 0.5px; }
.seo-table td { padding: 18px 24px; font-size: 14px; border-bottom: 1px solid #F3F4F6; color: #374151; vertical-align: top; line-height: 1.5; }
.seo-table tr:last-child td { border-bottom: none; }

.howto-section { margin-top: 48px; }
.howto-step { display: flex; gap: 20px; margin-bottom: 32px; background: #fff; padding: 24px; border-radius: 20px; border: 1px solid #E5E7EB; transition: box-shadow 0.2s, transform 0.2s; }
.howto-step:hover { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); transform: translateY(-2px); }
.step-num { width: 36px; height: 36px; background: var(--mod-bg); color: var(--mod-primary); font-weight: 800; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; border: 1px solid rgba(124, 58, 237, 0.2); }
.step-content h4 { margin: 0 0 10px 0; font-size: 18px; color: #111827; font-weight: 700; }
.step-content p { margin: 0; font-size: 16px; color: #6B7280; line-height: 1.6; }

.faq-section .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 16px; margin-bottom: 16px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item:hover { border-color: #D1D5DB; }
.faq-section .faq-item[open] { border-color: var(--mod-primary); box-shadow: 0 8px 20px rgba(0,0,0,0.05); }
summary.faq-question { padding: 22px 28px; cursor: pointer; font-weight: 700; color: var(--text-primary); font-size: 17px; list-style: none; position: relative; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-section .faq-item[open] summary.faq-question { color: var(--mod-primary); background: var(--mod-bg); border-bottom: 1px solid #E5E7EB; }
.faq-question::after { content: '+'; font-size: 26px; color: var(--text-secondary); font-weight: 400; line-height: 1; transition: transform 0.3s; }
.faq-section .faq-item[open] summary.faq-question::after { content: '−'; color: var(--mod-primary); }
.faq-answer, .faq-item div[itemprop="text"] { padding: 28px; color: var(--text-secondary); line-height: 1.7; font-size: 16px; background: #fff; }
.faq-answer p { margin: 0; }

@media (max-width: 900px) {
    .calc-header { margin-bottom: 32px; }
    .formulas-grid { grid-template-columns: 1fr; gap: 20px; }
    .icon-heading { font-size: 22px; gap: 12px; }
    .header-icon { width: 44px; height: 44px; font-size: 22px; }
    .formula-card { padding: 24px; }
    .howto-step { padding: 20px; gap: 16px; flex-direction: column; }
    .step-num { margin-bottom: -8px; }
    summary.faq-question { padding: 18px 20px; font-size: 16px; }
    .faq-answer, .faq-item div[itemprop="text"] { padding: 20px; font-size: 15px; }
}

@media (max-width: 480px) {
    .author-badge { padding: 16px; gap: 12px; align-items: flex-start; flex-direction: row; }
    .author-avatar { width: 40px; height: 40px; font-size: 18px; }
    .matrix-canvas { transform: scale(0.9); margin-bottom: 20px; }
    .di-subtitle, .di-text { padding-left: 0; margin-top: 8px; }
}