/* ===================================
   Security Base — Main Mobile-First CSS
   Базовые переменные и мобильная вёрстка

   NOTE: CSS Variables are now defined in design-tokens.css
   This file provides mobile-first component styles
   =================================== */

/* ===================================
   A3 a11y — Skip to content link (WCAG 2.1 AA, 2.4.1)
   Visually hidden until focused, then visible + high contrast.
   Navy #1E3A5F on white #FFFFFF = 11.50:1 (passes AA).
   =================================== */
.skip-link {
    position: absolute;
    top: -64px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    background: #FFFFFF;
    color: #1E3A5F;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: top 0.15s ease-in-out;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 8px;
    outline: 3px solid #3B82F6; /* visible focus ring, ~contrast vs white */
    outline-offset: 2px;
}

/* === Legacy variable aliases for backward compatibility === */
:root {
    /* Additional legacy mappings */
    --card-dark: var(--bg-dark-secondary);
    --text-primary: var(--text-on-dark-primary);
    --text-secondary: var(--text-on-dark-secondary);
    --text-invert: var(--text-on-light-primary);
    --text-muted-light: var(--text-on-light-secondary);
    --accent-2: var(--accent-success-light);
    --warning: var(--accent-warning-light);
}

/* === 2. Базовая нормализация === */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* === 3. Контейнеры === */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

.section {
    padding: 16px;
}

@media (min-width: 768px) {
    .section {
        padding: 32px 0;
    }
}

/* === 4. Карточки === */
.card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
}

@media (min-width: 768px) {
    .card {
        padding: 24px;
    }
}

/* === 5. Формы — Mobile-First === */
input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #0B0E13;
    color: var(--text-primary);
    padding: 12px 14px;
    font-size: 16px;
    line-height: 1.4;
    font-family: inherit;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    margin: 8px 0 6px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* === 6. Кнопки — Mobile-First === */
.btn,
button[type="submit"],
button[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    min-height: 44px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
}

@media (min-width: 640px) {
    .btn,
    button[type="submit"],
    button[type="button"] {
        width: auto;
        padding: 12px 24px;
    }
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid #93C5FD;
    outline-offset: 2px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-invert {
    background: #fff;
    color: var(--text-invert);
    border: 1px solid #E5E7EB;
}

.btn-invert:hover {
    background: #F3F4F6;
}

/* === 7. Ссылки === */
.link,
a {
    color: #93C5FD;
    text-decoration: none;
    transition: var(--transition);
}

.link:hover,
a:hover {
    text-decoration: underline;
}

.link-muted {
    color: var(--text-secondary);
}

.link-muted:hover {
    color: var(--text-primary);
}

/* === 8. Радио и чекбоксы — Mobile-First === */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: auto;
    cursor: pointer;
    transform: scale(1.2);
    margin-right: 8px;
    accent-color: var(--accent);
}

@media (min-width: 768px) {
    input[type="checkbox"],
    input[type="radio"] {
        transform: scale(1);
        margin-right: 12px;
    }
}

/* === 9. Списки с иконками === */
.hero-features-list,
.check-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-features-list li,
.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
}

@media (min-width: 768px) {
    .hero-features-list li,
    .check-list li {
        font-size: 18px;
        gap: 16px;
    }
}

.hero-features-list i,
.check-list i {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--accent-2);
    font-size: 20px;
    margin-top: 2px;
}

/* === 10. Карточки шагов === */
.step-number,
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 64, 175, 0.1);
    color: var(--brand-primary);
    border: none;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

@media (min-width: 768px) {
    .step-number,
    .feature-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        margin-bottom: 20px;
    }
}

/* === 11. Таблицы — Mobile Cards === */
@media (max-width: 767px) {
    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
    }

    .table tr {
        display: block;
        background: var(--card-dark);
        margin: 12px 0;
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 16px;
    }

    .table td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        color: var(--text-secondary);
        font-size: 12px;
        margin-bottom: 4px;
    }
}

/* === 12. Фильтры — Horizontal Scroll === */
.filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.filters::-webkit-scrollbar {
    height: 4px;
}

.filters::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.filters > * {
    flex-shrink: 0;
}

/* === 13. Hero Buttons === */
.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
        gap: 16px;
        justify-content: center;
    }
}

.hero-buttons .btn {
    width: 100%;
}

@media (min-width: 640px) {
    .hero-buttons .btn {
        width: auto;
    }
}

/* === 14. Trust Stats === */
.trust-stat {
    padding: 20px 16px;
    background: var(--bg-light-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-on-light);
    height: 100%;
}

.trust-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-primary-light);
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .trust-stat-number {
        font-size: 2.5rem;
    }
}

.trust-stat-label {
    font-size: 14px;
    color: var(--text-on-light-secondary);
}

@media (min-width: 768px) {
    .trust-stat-label {
        font-size: 16px;
    }
}

/* === 15. Feature Cards === */
.feature-card {
    background: var(--bg-light-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-on-light);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card .feature-icon {
    font-size: 2rem;
    color: var(--brand-primary);
    background: rgba(30, 64, 175, 0.1);
    border: none;
}

.feature-title {
    color: var(--text-on-light-primary);
    font-weight: 600;
    margin: 16px 0 12px;
    font-size: 1.125rem;
}

.feature-description {
    color: var(--text-on-light-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* === 16. Утилиты === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

/* === 17. Responsive Grid === */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.row > * {
    padding: 0 8px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

@media (min-width: 768px) {
    .col-md-6 { width: 50%; }
    .col-md-4 { width: 33.333%; }
    .col-md-3 { width: 25%; }
}

@media (min-width: 1024px) {
    .col-lg-4 { width: 33.333%; }
    .col-lg-3 { width: 25%; }
}

/* === 18. Gap Utilities === */
.g-3 > * {
    padding: 0.75rem;
}

.g-4 > * {
    padding: 1rem;
}

.g-5 > * {
    padding: 1.5rem;
}
