/* css/components.css */

/* =========================
   Брендинг / верхний блок
   ========================= */

.brand-text-main {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    /* без text-transform, оставляем «Double Digit» как есть */
    color: var(--ddc-navy);
}

.brand-text-sub {
    font-size: 11px;
    color: var(--ddc-gray);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(26,43,60,0.06) 0%, rgba(26,43,60,0.02) 100%);
    font-size: 11px;
    color: var(--ddc-navy);
    margin-top: 4px;
    border: 1px solid rgba(26,43,60,0.08);
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.20);
}

/* ==============
   Hero-текст
   ============== */

.hero-title {
    margin: 0;
    font-weight: 500;
    font-size: 40px;

    background: linear-gradient(
        180deg,
        rgba(203,150,102,0.85) 0%,
        rgba(182,125,70,0.72) 45%,
        rgba(150,95,50,0.55) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow:
        0 1px 3px rgba(0,0,0,0.35),
        0 0 14px rgba(203,150,102,0.25);
}

.hero-strategy {
    margin: 6px 0 0;
    font-weight: 400;
    font-size: 18px;

    background: linear-gradient(
        180deg,
        rgba(203,150,102,0.55) 0%,
        rgba(182,125,70,0.45) 40%,
        rgba(150,95,50,0.30) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow:
        0 1px 2px rgba(0,0,0,0.4),
        0 0 10px rgba(203,150,102,0.2);
}

/* убрать декоративную линию */
.hero-accent-line {
    display: none;
}

/* ==========================
   KPI-грид и KPI-карточки
   ========================== */

.kpi-grid {
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

/* KPI-карточка */
.kpi-card {
    position: relative;
    border-radius: var(--ddc-radius-md);
    background: #E5EBF2;
    padding: 20px 18px 18px;

    border: 1px solid rgba(184, 115, 51, 0.38);
    box-shadow:
        0 4px 10px rgba(0,0,0,0.08),
        inset 0 1px 2px rgba(255,255,255,0.6);

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border-top: 3px solid rgba(184,115,51,0.55);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-3px);
    background: #eceff3;
    border-color: rgba(0,0,0,0.08);
    box-shadow:
        0 6px 14px rgba(0,0,0,0.12),
        inset 0 1px 2px rgba(255,255,255,0.65);
}

.kpi-card:hover::before {
    opacity: 1;
}

/* надпись метрики (CAGR и т.п.) */
.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 800;
    color: #0E1A25;
    margin-bottom: 6px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* значение метрики */
.kpi-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: var(--ddc-letter-wide);
    color: #9F6239;
}

.kpi-sub {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 550;
    color: #162637;
    text-align: center;
}

.kpi-tag {
    display: none;
}

/* ==========
   Графики
   ========== */

.chart-frame {
    margin-top: 8px;
    border-radius: 18px;
    border: 1px solid rgba(184, 115, 51, 0.42);
    overflow: hidden;
    background: radial-gradient(circle at top, #ffffff 0, #f7f8fc 45%, #eef1f7 100%);
    box-shadow: 0 10px 24px rgba(15,23,42,0.10);
}

.chart-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.chart-footer {
    padding: 8px 14px 9px;
    font-size: 11px;
    color: var(--ddc-gray);
    text-align: right;
    border-top: 1px solid rgba(0,0,0,0.04);
    background: linear-gradient(90deg, #ffffff 0, #fafbfc 40%, #f2f4f8 100%);
}

/* ==========================
   Текст рядом с графиком
   ========================== */

.text-panel {
    font-size: 12px;
    color: #374151;
    line-height: 1.6;
}

.text-panel h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ddc-navy);
}

.bullet-list {
    margin: 6px 0 0 0;
    padding-left: 18px;
}

.bullet-list li {
    margin: 3px 0;
}

.text-panel-note {
    margin-top: 10px;
}

/* ====================
   Таблица метрик
   ==================== */

.metrics-table-wrapper {
    margin-top: 18px;
    background: #fafbff;
    border-radius: var(--ddc-radius-md);
    border: 1px solid #e1e6f1;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}

.metrics-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--ddc-letter-wide);
    text-align: left;
    white-space: nowrap;
}

.metrics-table thead {
    background: linear-gradient(90deg, #182638 0%, #1f3046 40%, #233955 100%);
    color: #ffffff;
}

.metrics-table th,
.metrics-table td {
    padding: 8px 12px;
}

.metrics-table td:nth-child(2),
.metrics-table td:nth-child(3),
.metrics-table td:nth-child(4) {
    text-align: right;
}

.metrics-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.metrics-table tbody tr:nth-child(even) {
    background: #f3f5fb;
}

.metrics-table tbody tr td:first-child {
    color: var(--ddc-navy);
    font-weight: 600;
}

.metrics-table tbody tr:hover {
    background: #e9edf8;
}

.metrics-table .pos {
    color: var(--ddc-green);
}

.metrics-table .neg {
    color: var(--ddc-red);
}

/* ==========================
   Monthly returns table
   ========================== */

.monthly-table-wrap {
    margin-top: 8px;
    background: #ffffff;
    border-radius: var(--ddc-radius-md);
    border: 1px solid rgba(184, 115, 51, 0.28);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
}

.monthly-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: 11px;
}

.monthly-table th,
.monthly-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-align: center;
    white-space: nowrap;
}

.monthly-table th {
    background: #eef2f7;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: var(--ddc-letter-wide);
    color: var(--ddc-navy);
    font-weight: 600;
}

.monthly-table th:first-child,
.monthly-table td:first-child {
    font-weight: 600;
    color: var(--ddc-navy);
}

.monthly-table tbody tr:last-child td {
    border-bottom: 0;
}

.monthly-divider-left {
    border-left: 2px solid rgba(15, 23, 42, 0.12);
}

.return-positive {
    color: var(--ddc-copper);
    font-weight: 600;
}

.return-negative {
    color: #a5abb4;
    font-weight: 600;
}

.return-empty {
    color: rgba(108, 117, 125, 0.6);
}

.monthly-annual {
    color: var(--ddc-navy);
    font-weight: 700;
}

/* ============================
   Typography on dark hero
   ============================ */

.hero-header .brand-text-main {
    color: #F9FAFB;
}

.hero-header .brand-text-sub {
    color: rgba(249,250,251,0.72);
}

.hero-header .top-meta {
    color: rgba(229,231,235,0.90);
}

.hero-header .top-meta strong {
    color: #FFFFFF;
}

.hero-header .pill {
    background: rgba(15,23,42,0.76);
    border-color: rgba(148,163,184,0.70);
    color: #E5E7EB;
}

.hero-header .hero-sub {
    color: rgba(229,231,235,0.90);
}

/* ==============
   Footer brand
   ============== */

.footer-brand {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    gap: 6px;
}

.footer-dd {
    color: #1A2B3C;
}

.footer-qhf {
    color: #C2764A;
}

/* =================
   Section titles
   ================= */

.section-title-split {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.section-master {
    color: #C2764A;
    font-weight: 600;
}

.section-dashboard {
    font-weight: 600;
    color: #1A2B3C;
}

/* ======
   CTA
   ====== */

.kpi-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.kpi-card-cta {
    max-width: 320px;
    margin: 14px auto 0;
}

.kpi-card-link:focus-visible {
    outline: 2px solid rgba(184,115,51,0.85);
    outline-offset: 2px;
}

.section-cta {
    display: flex;
    align-items: center;
gap: 10px;
}

.section-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 16px;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 600;
    letter-spacing: var(--ddc-letter-wide);
    text-transform: uppercase;
    text-decoration: none;

    border: 1px solid rgba(184, 115, 51, 0.70);
    background: rgba(255, 255, 255, 0.96);
    color: #0E1A25;

    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.10),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease;
}

.section-cta-btn:hover {
    background: #FFF7F0;
    box-shadow:
        0 6px 14px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.section-cta-btn:active {
    transform: translateY(0);
    box-shadow:
        0 3px 8px rgba(15, 23, 42, 0.12);
}

.section-cta-btn:focus-visible {
    outline: 2px solid rgba(184, 115, 51, 0.85);
    outline-offset: 2px;
}

/* =========================
   KPI formula tooltip
   ========================= */

.kpi-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    border-radius: 50%;
    font-size: 7px;
    font-weight: 600;
    cursor: pointer;

    color: var(--ddc-copper);
    border: 1px solid rgba(184,115,51,0.70);
    background: rgba(255,255,255,0.96);
    box-shadow: 0 1px 2px rgba(15,23,42,0.15);

    padding: 0;
    background-clip: padding-box;
    appearance: none;
    -webkit-appearance: none;
}

.kpi-info:focus-visible {
    outline: 2px solid rgba(184,115,51,0.85);
    outline-offset: 2px;
}

.math-kpi {
    display: block;
    margin-bottom: 4px;
}

.kpi-tooltip {
    position: absolute !important;
    left: 50% !important;
    bottom: 130% !important;
    transform: translateX(-50%) !important;

    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;

    min-width: 220px;
    max-width: 300px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15,23,42,0.96);
    color: #F9FAFB;
    font-size: 9px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    box-shadow: 0 12px 30px rgba(15,23,42,0.45);
    transition: opacity 0.16s ease-out, transform 0.16s ease-out;
    z-index: 30;
}

/* Показываем только при hover / фокусе на кружке "?" */
.kpi-info:hover .kpi-tooltip,
.kpi-info:focus-within .kpi-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(-2px) !important;
}

/* Стрелочка снизу у тултипа */
.kpi-info::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 118%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(15,23,42,0.96) transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.16s ease-out;
}

.kpi-info:hover::before,
.kpi-info:focus-within::before {
    opacity: 1;
}

/* ========================================
   HERO SEGMENTS (Assets / Wealth / ...)
   Чёткие, без glow и blur
   ======================================== */

.hero-segments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.hero-segment {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 14px;
    border-radius: 999px;

    /* Чёткий контур, без размытия */
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: linear-gradient(
        135deg,
        rgba(5, 10, 20, 0.98),
        rgba(35, 55, 80, 0.95)
    );

    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: #f5f5f5;
    text-decoration: none;

    /* Важно: убираем весь glow/blur/transform, которые мылит текст */
    text-shadow: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    backdrop-filter: none;
    transform: none;

    cursor: pointer;
    transition:
        background 160ms ease-out,
        border-color 160ms ease-out,
        box-shadow 160ms ease-out,
        color 160ms ease-out;
}

/* Активный сегмент (можно сделать медным) */
.hero-segment.is-active {
    background: linear-gradient(135deg, #c78b48, #8b5625);
    color: #0b0f16;
    border-color: rgba(255, 242, 225, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Hover / focus – лёгкий, без мыла */
.hero-segment:hover,
.hero-segment:focus-visible {
    background: linear-gradient(
        135deg,
        rgba(10, 20, 35, 1),
        rgba(50, 80, 120, 1)
    );
    border-color: rgba(255, 255, 255, 0.85);
    outline: none;
}

/* Мобилки – чуть меньше шрифт, чтобы не лезло друг на друга */
@media (max-width: 640px) {
    .hero-segments {
        gap: 6px;
        margin-top: 12px;
    }

    .hero-segment {
        padding: 5px 10px;
        font-size: 10px;
        letter-spacing: 0.10em;
    }
}

/* =========================================
   FIX: ЧЁТКИЙ ТЕКСТ ДЛЯ ВСЕХ КАРТОЧЕК ГРУППЫ
   ========================================= */

.group-card {
    text-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-font-smoothing: antialiased !important;
    transform: none !important;
}

.group-card:hover {
    text-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    transform: scale(1.02); /* вместо translateY(-3px) */
}

/* Premium refresh overrides (quant) */
.brand-mark {
    background:
        radial-gradient(circle at 20% 0, #ffffff 0, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, var(--ddc-navy) 0%, var(--ddc-copper) 100%);
    box-shadow: 0 10px 20px rgba(12, 18, 28, 0.3);
}

.pill {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 34, 55, 0.12);
    color: var(--ddc-navy);
}

.pill-dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.hero-title-main {
    background: linear-gradient(90deg, #e7edf6 0%, #b3bccd 50%, #f5f7fb 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-title-accent {
    background: linear-gradient(90deg, #c18a52 0%, #d9ad7d 55%, #f3d7b7 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-header .hero-strategy {
    color: rgba(248, 246, 240, 0.92);
    text-shadow: 0 8px 18px rgba(10, 20, 30, 0.45);
}

.hero-header .hero-sub {
    color: #E9B48A;
    letter-spacing: 0.16em;
}

.kpi-card {
    background: linear-gradient(160deg, #ffffff 0%, #f2efe7 100%);
    border: 1px solid rgba(15, 34, 55, 0.12);
    box-shadow: var(--ddc-shadow-card);
}

.kpi-card::before {
    border-top: 2px solid rgba(193, 138, 82, 0.7);
    opacity: 1;
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(193, 138, 82, 0.45);
    box-shadow: 0 22px 36px rgba(12, 18, 28, 0.2);
}

.kpi-label {
    letter-spacing: 0.18em;
    color: var(--ddc-navy);
}

.kpi-value {
    color: var(--ddc-copper);
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    color: var(--ddc-gray);
}

.kpi-info {
    color: var(--ddc-copper);
    border: 1px solid rgba(193, 138, 82, 0.7);
}

.kpi-info:focus-visible {
    outline-color: rgba(193, 138, 82, 0.85);
}

.chart-frame {
    border: 1px solid rgba(15, 34, 55, 0.16);
    background: radial-gradient(circle at top, #ffffff 0, #f4f1ea 45%, #e4dfd6 100%);
    box-shadow: 0 12px 28px rgba(12, 18, 28, 0.16);
}

.chart-footer {
    background: linear-gradient(90deg, #ffffff 0%, #f5f1ea 40%, #ebe4d6 100%);
    color: var(--ddc-gray);
}

.metrics-table-wrapper {
    background: #f7f4ee;
    border: 1px solid rgba(15, 34, 55, 0.12);
    box-shadow: 0 12px 28px rgba(12, 18, 28, 0.12);
}

.metrics-table thead {
    background: linear-gradient(90deg, #0f2237 0%, #1b3350 55%, #0f2237 100%);
}

.metrics-table tbody tr:nth-child(even) {
    background: #f1ede4;
}

.metrics-table tbody tr:hover {
    background: #e6dfd0;
}

.metrics-table tbody tr td:first-child {
    color: var(--ddc-navy);
}

.section-title {
    color: var(--ddc-navy);
    letter-spacing: 0.08em;
}

.section-master {
    color: var(--ddc-copper);
}

.section-dashboard {
    color: var(--ddc-navy);
}

.section-cta-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f6efe5 100%);
    border: 1px solid rgba(193, 138, 82, 0.7);
    color: var(--ddc-navy);
    box-shadow:
        0 8px 18px rgba(12, 18, 28, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.6);
}

.section-cta-btn:hover {
    background: linear-gradient(135deg, #fff8ef 0%, #f1e3d2 100%);
    box-shadow:
        0 12px 22px rgba(12, 18, 28, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.75);
}

.section-cta-btn:focus-visible {
    outline: 2px solid rgba(193, 138, 82, 0.85);
}

.hero-segment {
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: linear-gradient(135deg, rgba(10, 18, 30, 0.96), rgba(26, 44, 68, 0.94));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.32);
}

.hero-segment.is-active {
    background: linear-gradient(135deg, #d0a06a, #9f6b38);
    color: #0b0f16;
    border-color: rgba(255, 242, 225, 0.9);
}

.hero-segment:hover,
.hero-segment:focus-visible {
    background: linear-gradient(135deg, rgba(15, 26, 40, 1), rgba(45, 72, 110, 1));
}

.footer-brand {
    color: var(--ddc-navy);
}

.footer-dd {
    color: var(--ddc-navy);
}

.footer-qhf {
    color: var(--ddc-copper);
}
