/* static/css/components.css */
/* ─── 1. Buttons ──────────────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #0D9488 0%, #0891B2 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 1rem;
    border: none;
    box-shadow:
        0 4px 14px rgba(13, 148, 136, 0.25),
        0 0 0 0 rgba(13, 148, 136, 0);
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
}

@media (min-width: 768px) {
    .btn-primary {
        padding: 1rem 2rem;
        font-size: 12px;
    }
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    transform: scale(1.5);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0ea69a 0%, #0aa3c7 100%);
    box-shadow:
        0 10px 30px -10px rgba(13, 148, 136, 0.6),
        0 0 0 1px rgba(255,255,255,0.1) inset;
    transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 5px 15px -5px rgba(13, 148, 136, 0.4);
}

.btn-primary i {
    width: 0.875rem;
    height: 0.875rem;
}

@media (min-width: 768px) {
    .btn-primary i {
        width: 1rem;
        height: 1rem;
    }
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background-color: #fff;
    color: #0D9488;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 1rem;
    border: 2px solid rgba(13, 148, 136, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
}

@media (min-width: 768px) {
    .btn-secondary {
        padding: 0.875rem 1.75rem;
        font-size: 12px;
    }
}

.btn-secondary:hover {
    background-color: rgba(13, 148, 136, 0.04);
    border-color: #0D9488;
    box-shadow: 0 8px 25px -8px rgba(13, 148, 136, 0.15);
    transform: translateY(-2px);
    color: #0b786f;
}

.btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary i {
    width: 0.875rem;
    height: 0.875rem;
}

@media (min-width: 768px) {
    .btn-secondary i {
        width: 1rem;
        height: 1rem;
    }
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    background-color: transparent;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.btn-ghost:hover {
    color: var(--color-primary);
}

.btn-ghost i {
    width: 16px;
    height: 16px;
}

/* ─── 2. Badges & Tooltips ────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 9999px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-popular {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-science {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
    pointer-events: none;
    letter-spacing: 0.02em;
    text-transform: none;
}

.has-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-6px);
}

/* ─── 3. Accordion (CSP-safe) ─────────────────────────────── */

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content > * {
    overflow: hidden;
}

.accordion-content.open {
    grid-template-rows: 1fr;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-icon.rotated {
    transform: rotate(45deg);
}

/* ─── 4. Form Inputs ──────────────────────────────────────── */

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: var(--color-text);
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder {
    color: var(--color-muted);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ─── 5. Tab Switcher ─────────────────────────────────────── */

.tab-switcher {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background-color: rgba(229, 231, 235, 0.5);
    border-radius: 0.75rem;
    border: 1px solid var(--color-border);
}

.tab-switcher__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
    background-color: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-switcher__btn:hover {
    color: var(--color-text);
}

.tab-switcher__btn.is-active {
    background-color: #fff;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.tab-count {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-muted);
    opacity: 0.7;
}

.tab-content {
    display: none;
}

.tab-content.is-active {
    display: block;
}

/* ─── 6. Notes ────────────────────────────────────────────── */

.note-inline {
    font-size: 12px;
    color: rgba(107, 114, 128, 0.95);
    line-height: 1.45;
}

.note-inline strong {
    color: rgba(17, 24, 39, 0.8);
}

/* ─── 7. Legal / Prose ────────────────────────────────────── */

.legal.prose h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal.prose p {
    color: var(--color-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.legal.prose ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal.prose ul li {
    color: var(--color-muted);
    line-height: 1.7;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.legal.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal.prose a:hover {
    color: var(--color-text);
}

/* ─── 8. How-to Steps ─────────────────────────────────────── */

.how-buy__step {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background-color: var(--color-bg);
    border-radius: 1rem;
    border: 1px solid var(--color-border);
}

.how-buy__num {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.how-buy__title {
    font-weight: 700;
    color: var(--color-text);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.how-buy__desc {
    font-size: 0.8125rem;
    color: var(--color-muted);
    line-height: 1.5;
}

.how-buy__note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: rgba(17, 24, 39, 0.03);
    border-radius: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-muted);
    line-height: 1.5;
}

/* ─── 9. CERTIFICATES SECTION ─────────────────────────────── */

.cert-section {
    padding: 2.5rem 0;
    background: linear-gradient(180deg, #f8fffe 0%, #ffffff 100%);
    border-top: 1px solid rgba(13, 148, 136, 0.08);
    border-bottom: 1px solid rgba(13, 148, 136, 0.08);
    position: relative;
    overflow: hidden;
}

.cert-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(13, 148, 136, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(8, 145, 178, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.cert-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.cert-header__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(13, 148, 136, 0.2) 50%,
        transparent 100%
    );
}

.cert-header__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-muted);
    white-space: nowrap;
}

@media (min-width: 768px) {
    .cert-header__label {
        font-size: 11px;
    }
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .cert-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .cert-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
    }
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid rgba(13, 148, 136, 0.1);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0D9488, #0891B2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-card:hover {
    border-color: rgba(13, 148, 136, 0.25);
    box-shadow:
        0 4px 20px -4px rgba(13, 148, 136, 0.12),
        0 0 0 1px rgba(13, 148, 136, 0.05);
    transform: translateY(-2px);
}

.cert-card:hover::before {
    opacity: 1;
}

.cert-card__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(8, 145, 178, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.cert-card:hover .cert-card__icon {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.15) 0%, rgba(8, 145, 178, 0.15) 100%);
}

.cert-card__icon i,
.cert-card__icon svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-primary);
    stroke-width: 2;
}

.cert-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.cert-card__title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.cert-card__desc {
    font-size: 0.6875rem;
    color: var(--color-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 639px) {
    .cert-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .cert-card__icon {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
    }

    .cert-card__icon i,
    .cert-card__icon svg {
        width: 0.875rem;
        height: 0.875rem;
    }

    .cert-card__title {
        font-size: 0.75rem;
    }

    .cert-card__desc {
        display: none;
    }
}

/* ─── 10. Toast (CSP-safe) ───────────────────────────────── */

.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 90;

    padding: 0.75rem 1rem;
    border-radius: 9999px;
    background: rgba(17, 24, 39, 0.92);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 55px rgba(0,0,0,0.25);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .toast {
        bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* ─── 11. Breadcrumbs ─────────────────────────────────────── */
/* Минимальный текстовый дизайн с иконкой дома */

.breadcrumbs {
    display: block;
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
}

.breadcrumbs__link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.breadcrumbs__link:hover {
    color: var(--color-primary);
}

.breadcrumbs__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.breadcrumbs__link:hover .breadcrumbs__icon {
    opacity: 1;
}

.breadcrumbs__sep {
    width: 14px;
    height: 14px;
    color: var(--color-border);
    margin: 0 0.375rem;
    flex-shrink: 0;
}

.breadcrumbs__current {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(480px, 65vw);
}

/* ─── 12. Science page helpers (minimal, modern) ───────────── */

.reading-progress {
    position: sticky;
    top: 0;
    z-index: 60;
    height: 3px;
    width: 100%;
    background: rgba(229, 231, 235, 0.8);
}

.reading-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.toc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border-radius: 9999px;
    background: white;
    border: 1px solid var(--color-border);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(107, 114, 128, 0.95);
}

.toc-chip:hover {
    color: var(--color-primary);
    border-color: rgba(13, 148, 136, 0.25);
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.9rem;
    color: rgba(107, 114, 128, 0.95);
    font-size: 12px;
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease;
}

.toc-link:hover {
    background: rgba(13, 148, 136, 0.06);
    color: rgba(13, 148, 136, 0.95);
}

.toc-link__marker {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: rgba(209, 213, 219, 0.9);
    flex-shrink: 0;
}

.toc-link.is-active {
    background: rgba(13, 148, 136, 0.08);
    color: rgba(13, 148, 136, 0.95);
}

.toc-link.is-active .toc-link__marker {
    background: rgba(13, 148, 136, 0.95);
}

.science-section__num {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(13, 148, 136, 0.10);
    color: rgba(13, 148, 136, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oswald', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.science-pillar-card {
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: white;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    min-height: 260px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.science-pillar-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 148, 136, 0.25);
    box-shadow: var(--shadow-md);
}

.science-pillar-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.science-pullquote {
    margin: 0;
    padding: 1.5rem 1.75rem;
    border-radius: 1.5rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-sm);
}

.science-pullquote p {
    margin: 0;
    color: rgba(17, 24, 39, 0.82);
    font-weight: 700;
    line-height: 1.55;
}