/* СБРОС И ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: #f4f7fc;
  color: #1e293b;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* КОНТЕЙНЕР */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ШАПКА + НАВИГАЦИЯ */
.header {
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02), 0 2px 6px rgba(0,40,80,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.85);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  flex-wrap: wrap;
}

.logo a {
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

/* Десктоп меню */
.nav-menu {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  font-weight: 500;
  color: #1e293b;
  transition: 0.2s;
  font-size: 1rem;
}

.nav-menu a:hover, .nav-menu a.active {
  color: #2563eb;
}

/* ВЫПАДАЮЩЕЕ МЕНЮ под заголовком */
.sub-nav {
  background: #ffffffdd;
  border-top: 1px solid #e9eef3;
  border-bottom: 1px solid #e9eef3;
  padding: 8px 0;
  backdrop-filter: blur(4px);
}

.sub-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
}

.sub-nav-links a {
  text-decoration: none;
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.sub-nav-links a i {
  color: #2563eb;
  font-size: 0.9rem;
}

.sub-nav-links a:hover {
  color: #2563eb;
}

/* мобильный переключатель */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid #d0d9e8;
  border-radius: 40px;
  padding: 8px 16px;
  font-size: 1rem;
  color: #1e293b;
  cursor: pointer;
  align-items: center;
  gap: 6px;
}

.mobile-toggle i {
  font-size: 1.2rem;
}

/* выпадающий блок для мобильного меню */
.mobile-dropdown {
  display: none;
  flex-direction: column;
  background: white;
  border-radius: 24px;
  padding: 16px 20px;
  margin-top: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.mobile-dropdown a {
  padding: 12px 0;
  border-bottom: 1px solid #f0f4fa;
  text-decoration: none;
  color: #1e293b;
  font-weight: 500;
}

.mobile-dropdown a:last-child {
  border-bottom: none;
}

/* Кнопки Вход/Регистрация */
.auth-buttons {
  display: flex;
  gap: 12px;
}

.btn-outline {
  padding: 8px 18px;
  border-radius: 40px;
  border: 1.5px solid #2563eb;
  background: transparent;
  color: #2563eb;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: 0.2s;
}

.btn-outline:hover {
  background: #2563eb;
  color: white;
}

.btn-primary {
  padding: 8px 22px;
  border-radius: 40px;
  background: #2563eb;
  border: none;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: 0.2s;
  box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

.btn-primary:hover {
  background: #1e4fbf;
  transform: translateY(-2px);
}

/* ЗАГОЛОВКИ СТРАНИЦ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 16px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
}

.test-count {
  background: #d9e8ff;
  padding: 6px 16px;
  border-radius: 40px;
  font-weight: 500;
}

/* ДВУХКОЛОНОЧНАЯ СЕТКА ДЛЯ ТЕСТОВ */
.tests-two-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 40px 0;
}

/* ШИРОКИЕ КАРТОЧКИ ТЕСТОВ */
.test-card-wide {
  background: white;
  border-radius: 32px;
  padding: 28px;
  box-shadow: 0 10px 25px rgba(0,20,40,0.04);
  transition: 0.2s ease;
  border: 1px solid rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
}

.test-card-wide:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 36px -12px rgba(37,99,235,0.15);
  border-color: #cddffb;
}

.test-card-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.test-icon {
  font-size: 2.5rem;
  color: #2563eb;
  min-width: 50px;
}

.test-title-group {
  flex: 1;
}

.test-title-group h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.test-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
}

.difficulty-4 {
  background: #fef3c7;
  color: #92400e;
}

.difficulty-3 {
  background: #dbeafe;
  color: #1e40af;
}

.difficulty-5 {
  background: #fee2e2;
  color: #991b1b;
}

.difficulty-2 {
  background: #dcfce7;
  color: #166534;
}

.time {
  background: #f1f5f9;
  color: #334155;
}

.test-description {
  color: #334155;
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 1rem;
}

.test-meta-detailed {
  display: flex;
  gap: 24px;
  color: #5f6c84;
  font-size: 0.9rem;
  margin: 16px 0;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.test-meta-detailed i {
  margin-right: 6px;
  color: #2563eb;
}

.test-card-wide .btn-link {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
}

.test-card-wide .btn-link:hover {
  border-bottom-color: #2563eb;
}

/* СТРАНИЦА ПРИМЕР ТЕСТА */
.question-section {
  background: white;
  border-radius: 40px;
  padding: 40px;
  margin: 32px 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.04);
}

.progress-container {
  margin-bottom: 32px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #475569;
}

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 40px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 40px;
}

.question-item {
  margin-bottom: 40px;
  border-bottom: 1px solid #eef3f8;
  padding-bottom: 28px;
}

.question-item:last-child {
  border-bottom: none;
}

.question-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.option-hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 8px;
  font-style: italic;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option, .checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafd;
  padding: 12px 18px;
  border-radius: 50px;
  border: 1px solid #e2eaf2;
  transition: 0.15s;
  cursor: pointer;
}

.radio-option:hover, .checkbox-option:hover {
  background: #ecf2f9;
  border-color: #2563eb;
}

input[type="radio"], input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
}

.text-input-field {
  width: 100%;
  padding: 16px 22px;
  border-radius: 60px;
  border: 1px solid #dce3ec;
  font-size: 1rem;
  transition: 0.2s;
  background: #fbfdff;
}

.text-input-field:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}

textarea.text-input-field {
  border-radius: 32px;
  resize: vertical;
}

.action-buttons {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* СТРАНИЦА ТЕКСТА С ИЛЛЮСТРАЦИЯМИ */
.info-page-content {
  background: white;
  border-radius: 40px;
  padding: 40px;
  margin: 32px 0;
}

.info-block {
  display: flex;
  gap: 50px;
  align-items: center;
  margin-bottom: 70px;
}

.info-block.reverse {
  flex-direction: row-reverse;
}

.info-block:last-child {
  margin-bottom: 0;
}

.info-text {
  flex: 1.2;
}

.info-text h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #0f172a;
}

.info-text p {
  margin-bottom: 16px;
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.7;
}

.info-features {
  list-style: none;
  margin-top: 20px;
}

.info-features li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-features i {
  color: #2563eb;
  font-size: 1.2rem;
}

.stats-preview {
  display: flex;
  gap: 30px;
  margin-top: 25px;
  background: #f8fafc;
  padding: 20px;
  border-radius: 30px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-illustration {
  flex: 0.8;
  background: linear-gradient(145deg, #e2ebf7, #f6faff);
  border-radius: 48px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: #2563eb;
  font-size: 5rem;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
  text-align: center;
}

.illustration-caption {
  font-size: 1rem;
  color: #1e293b;
  margin-top: 16px;
  font-weight: 500;
}

/* ПОДВАЛ */
.footer {
  background: white;
  margin-top: 60px;
  padding: 40px 0 30px;
  border-top: 1px solid #e7ecf5;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 40px;
}

.footer-col p {
  font-weight: 600;
  margin-bottom: 20px;
  color: #0a1c2f;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 14px;
}

.footer-col a {
  text-decoration: none;
  color: #475569;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-col a:hover {
  color: #2563eb;
}

.popular-badge {
  background: #f0f4fe;
  border-radius: 40px;
  padding: 2px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  margin-left: 8px;
}

.copyright {
  margin-top: 48px;
  text-align: center;
  color: #6e7b94;
  font-size: 0.9rem;
}

/* Секция возможностей (карточки как на главной) */
        .section-title {
            font-size: 2rem;
            font-weight: 700;
            text-align: center;
            margin: 60px 0 40px;
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 24px;
            margin-bottom: 60px;
        }

        .feature-card {
            background: white;
            border-radius: 32px;
            padding: 32px 24px;
            text-align: center;
            transition: 0.3s;
            box-shadow: 0 10px 25px rgba(0,20,40,0.04);
            border: 1px solid rgba(0,0,0,0.02);
        }

        .feature-card:hover {
            transform: translateY(-6px);
            box-shadow: 0 24px 36px -12px rgba(37,99,235,0.15);
            border-color: #cddffb;
        }

        .feature-icon {
            font-size: 3rem;
            color: #2563eb;
            margin-bottom: 20px;
        }

        .feature-card h3 {
            font-size: 1.5rem;
            margin-bottom: 12px;
        }

        .feature-card p {
            color: #475569;
        }

        /* Блок описания (как question-section) */
        .description-block {
            background: white;
            border-radius: 40px;
            padding: 40px;
            margin: 48px 0;
            box-shadow: 0 12px 30px rgba(0,0,0,0.04);
        }

        .description-block h2 {
            font-size: 1.8rem;
            margin-bottom: 24px;
        }

        .description-text {
            font-size: 1.05rem;
            line-height: 1.7;
            color: #334155;
        }

        .description-text p {
            margin-bottom: 16px;
        }

        /* Список преимуществ (как в основном сайте) */
        .highlight-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 12px;
            margin: 30px 0 0;
        }

        .highlight-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 18px;
            background: #f8fafd;
            border-radius: 60px;
            border: 1px solid #e2eaf2;
            transition: 0.15s;
        }

        .highlight-item i {
            color: #2563eb;
            font-size: 1.1rem;
        }

        .highlight-item:hover {
            background: #ecf2f9;
            border-color: #2563eb;
        }

        /* Возможности системы (как capabilities в стиле карточек) */
        .capabilities {
            background: white;
            border-radius: 40px;
            padding: 40px;
            margin: 48px 0;
            box-shadow: 0 12px 30px rgba(0,0,0,0.04);
        }

        .capabilities h2 {
            font-size: 1.8rem;
            margin-bottom: 32px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .capabilities-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 16px;
        }

        .capability-item {
            display: flex;
            gap: 14px;
            align-items: flex-start;
            padding: 16px;
            background: #f8fafd;
            border-radius: 24px;
            border: 1px solid #e2eaf2;
            transition: 0.2s;
        }

        .capability-item:hover {
            background: #ecf2f9;
            border-color: #2563eb;
        }

        .capability-item i {
            font-size: 1.3rem;
            color: #2563eb;
            min-width: 32px;
            margin-top: 2px;
        }

        .capability-item span {
            color: #1e293b;
            line-height: 1.5;
        }
        /* ГЕРОЙ СЕКЦИЯ */
        .hero {
            background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
            border-radius: 0 0 48px 48px;
            padding: 60px 0 50px;
            margin-bottom: 48px;
            text-align: center;
        }

        .hero h1 {
            font-size: 3rem;
            font-weight: 800;
            margin-bottom: 20px;
            background: linear-gradient(135deg, #1e293b, #2563eb);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .hero p {
            font-size: 1.2rem;
            color: #334155;
            max-width: 700px;
            margin: 0 auto 32px;
        }

        .hero-buttons {
            display: flex;
            gap: 16px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Инфо-карточки (как test-card-wide) */
        .info-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 24px;
            margin: 48px 0;
        }

        .info-card {
            background: white;
            border-radius: 32px;
            padding: 28px;
            transition: 0.2s;
            border: 1px solid rgba(0,0,0,0.02);
            box-shadow: 0 10px 25px rgba(0,20,40,0.04);
        }

        .info-card:hover {
            transform: translateY(-6px);
            box-shadow: 0 24px 36px -12px rgba(37,99,235,0.15);
            border-color: #cddffb;
        }

        .info-card i {
            font-size: 2.5rem;
            color: #2563eb;
            margin-bottom: 20px;
            display: inline-block;
        }

        .info-card h3 {
            font-size: 1.4rem;
            margin-bottom: 12px;
        }

        .info-card p {
            color: #475569;
            margin-bottom: 16px;
        }

        .info-card a {
            color: #2563eb;
            text-decoration: none;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .info-card a:hover {
            gap: 10px;
        }

        /* Секция отзывов (стилизованная) */
        .reviews-section {
            background: linear-gradient(135deg, #2563eb, #1e40af);
            border-radius: 40px;
            padding: 48px;
            margin: 48px 0;
            text-align: center;
            color: white;
        }

        .reviews-section h2 {
            font-size: 1.8rem;
            margin-bottom: 16px;
        }

        .reviews-section p {
            font-size: 1.1rem;
            opacity: 0.95;
            margin-bottom: 24px;
        }

        .review-link {
            display: inline-block;
            padding: 12px 32px;
            background: white;
            color: #2563eb;
            border-radius: 40px;
            text-decoration: none;
            font-weight: 600;
            transition: 0.2s;
        }

        .review-link:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        }
/* СТАТИСТИКА */
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 32px;
        }

        .stat-card {
            background: white;
            border-radius: 28px;
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 16px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.04);
            border: 1px solid #eef2ff;
        }

        .stat-icon {
            width: 50px;
            height: 50px;
            background: #eff6ff;
            border-radius: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: #2563eb;
        }

        .stat-info h3 {
            font-size: 1.8rem;
            font-weight: 700;
        }

        .stat-info p {
            color: #64748b;
            font-size: 0.9rem;
        }

        /* ТАБЛИЦА ВОПРОСОВ (адаптивная) */
        .questions-table-container {
            background: white;
            border-radius: 32px;
            padding: 0;
            overflow-x: auto;
            box-shadow: 0 12px 30px rgba(0,0,0,0.04);
            margin-bottom: 40px;
        }

        .questions-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 600px;
        }

        .questions-table th {
            text-align: left;
            padding: 18px 16px;
            background: #f8fafc;
            font-weight: 600;
            color: #1e293b;
            border-bottom: 2px solid #e2e8f0;
        }

        .questions-table td {
            padding: 16px;
            border-bottom: 1px solid #f1f5f9;
            vertical-align: middle;
        }

        .questions-table tr:hover {
            background: #fafcff;
        }

        .question-type-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 40px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .type-single {
            background: #dbeafe;
            color: #1e40af;
        }

        .type-multiple {
            background: #dcfce7;
            color: #166534;
        }

        .type-text {
            background: #fef3c7;
            color: #92400e;
        }

        .action-buttons-cell {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* МОДАЛЬНОЕ ОКНО (всплывающее) */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(4px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal {
            background: white;
            border-radius: 40px;
            width: 90%;
            max-width: 650px;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px rgba(0,0,0,0.25);
            animation: modalSlideIn 0.3s ease;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            padding: 24px 28px;
            border-bottom: 1px solid #eef2ff;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h2 {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #94a3b8;
            transition: 0.2s;
        }

        .modal-close:hover {
            color: #1e293b;
        }

        .modal-body {
            padding: 28px;
        }

        .options-group {
            background: #f8fafc;
            border-radius: 24px;
            padding: 16px;
            margin-top: 8px;
        }

        .option-row {
            display: flex;
            gap: 12px;
            margin-bottom: 12px;
            align-items: center;
        }

        .option-row input {
            flex: 1;
        }

        .btn-add-option {
            padding: 10px 20px;
            background: #f1f5f9;
            border: 1px dashed #2563eb;
            border-radius: 40px;
            color: #2563eb;
            cursor: pointer;
            width: 100%;
            margin-top: 8px;
        }

        .modal-footer {
            padding: 20px 28px;
            border-top: 1px solid #eef2ff;
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        /* Пустое состояние */
        .empty-state {
            text-align: center;
            padding: 60px;
            color: #94a3b8;
        }

        .empty-state i {
            font-size: 4rem;
            margin-bottom: 16px;
        }

/* ========== АДАПТИВНЫЕ ИЗОБРАЖЕНИЯ ========== */

/* Базовый адаптивный класс для изображений */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Адаптивные изображения с фиксированной пропорцией */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Контейнер для изображений с сохранением пропорций */
.img-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.img-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Для иконок и маленьких изображений */
.img-icon {
    width: auto;
    height: auto;
    max-width: none;
    display: inline-block;
}

/* Конкретные размеры для маленьких картинок */
.img-30x30 {
    width: 30px;
    height: 30px;
    object-fit: cover;
    max-width: none;
}

.img-40x40 {
    width: 40px;
    height: 40px;
    object-fit: cover;
    max-width: none;
}

.img-50x50 {
    width: 50px;
    height: 50px;
    object-fit: cover;
    max-width: none;
}

/* Изображения с фиксированным соотношением сторон (16:9) */
.img-16x9 {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 = 9/16 = 0.5625 */
    overflow: hidden;
}

.img-16x9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Изображения с фиксированным соотношением сторон (4:3) */
.img-4x3 {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 = 3/4 = 0.75 */
    overflow: hidden;
}

.img-4x3 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Изображения с фиксированным соотношением сторон (1:1 квадрат) */
.img-square {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 */
    overflow: hidden;
}

.img-square img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Картинки с круглой формой (аватарки) */
.img-circle {
    border-radius: 50%;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Картинки со скругленными углами */
.img-rounded {
    border-radius: 24px;
}

/* Картинки с тенью */
.img-shadow {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Картинки с рамкой */
.img-bordered {
    border: 2px solid #e2e8f0;
    padding: 4px;
    background: white;
}

/* Галерея изображений (сетка) */
.img-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.img-gallery-item {
    overflow: hidden;
    border-radius: 24px;
}

.img-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.img-gallery-item img:hover {
    transform: scale(1.05);
}

/* Изображение с подписью */
.img-caption {
    position: relative;
}

.img-caption figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 40px 20px 20px;
    border-radius: 0 0 24px 24px;
    font-size: 0.9rem;
}

/* Ленивая загрузка (блейп-эффект) */
.img-lazy {
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.img-lazy img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-lazy img.loaded {
    opacity: 1;
}

/* Скелетон загрузки */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========== АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ ========== */

@media (max-width: 480px) {
    /* На маленьких экранах галерея в 1 колонку */
    .img-gallery {
        grid-template-columns: 1fr;
    }
    
    .img-gallery-item img {
        height: 200px;
    }
    
    /* Увеличиваем отступы */
    .img-rounded {
        border-radius: 12px;
    }
}

/* АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ */
@media screen and (max-width: 900px) {
  .nav-menu {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .auth-buttons {
    margin-left: auto;
  }

  .tests-two-columns {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }
            
  .hero p {
    font-size: 1rem;
  }
}

@media screen and (max-width: 700px) {
  .info-block, .info-block.reverse {
    flex-direction: column;
    gap: 30px;
  }
  
  .stats-preview {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .info-illustration {
    width: 100%;
    min-height: 200px;
  }

  /* На мобильных картинки занимают всю ширину */
    img {
        width: 100%;
    }
    
    /* Уменьшаем скругление на мобильных */
    .img-rounded {
        border-radius: 16px;
    }
    
    /* Галерея на мобильных в 1-2 колонки */
    .img-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .img-gallery-item img {
        height: 180px;
    }
    
    /* Уменьшаем подписи на мобильных */
    .img-caption figcaption {
        font-size: 0.8rem;
        padding: 30px 12px 12px;
    }
    /* Фиксированные размеры сохраняются */
    .img-30x30 {
        width: 30px !important;
        height: 30px !important;
    }
    
    .img-40x40 {
        width: 40px !important;
        height: 40px !important;
    }
    
    .img-50x50 {
        width: 50px !important;
        height: 50px !important;
    }
    
    .img-avatar {
        width: 60px !important;
        height: 60px !important;
    }
}

@media screen and (max-width: 600px) {
  .container {
    padding: 0 18px;
  }

  .sub-nav-links {
    gap: 16px;
    justify-content: space-between;
  }

  .sub-nav-links a span {
    display: none;
  }

  .sub-nav-links a i {
    font-size: 1.2rem;
  }

  .question-section {
    padding: 24px;
  }
  
  .info-page-content {
    padding: 24px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons a {
    text-align: center;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}