﻿:root {
  --blue: #1e3a8a;
  --red: #c1121f;
  --light: #f8f9fa;
  --gray: #e9ecef;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--light);
  margin: 0;
  color: #222;
}

.container {
  max-width: 900px;
  margin: 30px auto;
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

h1, h2 { color: var(--blue); }
h1 { font-size: 2rem; margin-bottom: .3rem; }
h2 { font-size: 1.3rem; }

.subtitle { color: #555; font-size: .95rem; }

/* Чекбокс согласия — компактный, в начале строки */
.start-form .agree-label {
  display: flex !important;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  margin: 16px 0 8px;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  line-height: 1.45;
  font-size: 0.95rem;
  text-align: left;
  font-weight: normal;
}

.start-form .agree-label:hover {
  border-color: #1e3a8a;
  background: #f0f4ff;
}

.start-form .agree-label input[type="checkbox"] {
  margin: 3px 0 0 0;
  padding: 0;
  width: 16px;
  height: 16px;
  transform: scale(1.25);
  transform-origin: left center;
  accent-color: #c1121f;
  cursor: pointer;
  flex-shrink: 0;
}

.start-form .agree-label a {
  color: #1e3a8a;
  text-decoration: underline;
}

.start-form .agree-label a:hover {
  color: #c1121f;
}

.start-form .agree-label span {
  flex: 1 1 auto;
  display: inline;
}

button, .btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--red);
  color: #fff;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: #a10e18; }

.options { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--gray);
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}
.option:hover { border-color: var(--blue); background: #eef2ff; }
.option input { transform: scale(1.2); }

.progress { font-size: .9rem; color: #666; margin-bottom: 20px; }
.progress-bar {
  height: 8px; background: var(--gray); border-radius: 4px; margin-top: 6px;
}
.progress-bar span {
  display: block; height: 100%; background: var(--blue);
  border-radius: 4px; transition: width .3s;
}

.error {
  background: #ffe5e5; color: #a10e18;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 20px;
}
.score { font-size: 1.2rem; }
.cert { max-width: 100%; border: 1px solid var(--gray); border-radius: 8px; }

.option.selected {
  border-color: var(--blue);
  background: #eef2ff;
  font-weight: 600;
}

/* Прогресс */
.progress {
    margin-bottom: 24px;
}
.progress-text {
    font-size: .95rem;
    color: #555;
    margin-bottom: 8px;
}
.progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a, #c1121f);
    border-radius: 5px;
    transition: width .4s ease;
}

/* Вопрос */
.question-title {
    font-size: 1.15rem;
    line-height: 1.5;
    color: #1e3a8a;
    margin-bottom: 8px;
}
.hint {
    font-size: .85rem;
    color: #888;
    font-style: italic;
    margin-bottom: 12px;
}

/* Варианты */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 24px;
}
.option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
    background: #fff;
}
.option:hover {
    border-color: #1e3a8a;
    background: #f0f4ff;
}
.option.selected {
    border-color: #1e3a8a;
    background: #eef2ff;
    box-shadow: 0 0 0 2px rgba(30,58,138,.1);
}
.option input {
    margin-top: 3px;
    transform: scale(1.25);
    accent-color: #c1121f;
    cursor: pointer;
    flex-shrink: 0;
}
.option-text {
    line-height: 1.45;
    font-size: .98rem;
}

/* Кнопки навигации */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}
.btn-primary {
    background: #c1121f;
    color: #fff;
}
.btn-primary:hover { background: #a10e18; }
.btn-secondary {
    background: #e9ecef;
    color: #333;
}
.btn-secondary:hover { background: #d6d9dd; }
.btn:disabled {
    opacity: .6;
    cursor: wait;
}

/* Мобильные */
@media (max-width: 600px) {
    .container { padding: 20px 18px; margin: 12px; }
    .nav-buttons { flex-direction: column-reverse; }
    .btn { width: 100%; }
}

/* Успех / ошибка */
.success-box {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 20px 0;
    color: #1b5e20;
}
.error-box {
    background: #ffebee;
    border-left: 4px solid #c1121f;
    padding: 18px 22px;
    border-radius: 8px;
    margin: 20px 0;
    color: #7f1010;
    line-height: 1.6;
}
.error-box p { margin: 6px 0; }

/* Ссылка «Пройти заново» */
.restart-link {
    margin-top: 30px;
    text-align: center;
}
.restart-link a {
    color: #1e3a8a;
    font-weight: 600;
    text-decoration: none;
}
.restart-link a:hover { text-decoration: underline; }

/* PNG-сертификат */
.cert {
    max-width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    display: block;
    margin: 10px 0;
}

/* ---- HTML/CSS-сертификат (fallback) ---- */
.cert-html {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 1.414 / 1; /* A4 landscape */
    background: #fff;
    border: 4px solid #1e3a8a;
    border-radius: 10px;
    padding: 30px 40px;
    box-sizing: border-box;
    position: relative;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cert-html-inner {
    text-align: center;
    width: 100%;
    font-family: 'Georgia', serif;
}
.cert-html-header {
    font-size: 2.4rem;
    font-weight: bold;
    color: #c1121f;
    letter-spacing: 4px;
    margin-bottom: 6px;
}
.cert-html-sub {
    font-size: 1rem;
    color: #555;
    margin-bottom: 24px;
}
.cert-html-name {
    font-size: 2rem;
    font-weight: bold;
    color: #1e3a8a;
    margin: 20px 0;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 14px;
}
.cert-html-text {
    font-size: 1.05rem;
    color: #333;
    line-height: 1.6;
    margin: 20px 0;
}
.cert-html-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    font-size: .95rem;
    color: #333;
}
.cert-html-sign {
    font-style: italic;
    border-bottom: 1px solid #999;
    padding: 0 20px 4px;
}

/* Стили для страницы privacy.php */
.privacy-text {
  line-height: 1.65;
  color: #333;
}

.privacy-text h3 {
  color: #1e3a8a;
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.15rem;
  border-left: 4px solid #c1121f;
  padding-left: 12px;
}

.privacy-text ul {
  margin: 10px 0 10px 20px;
  padding: 0;
}

.privacy-text li {
  margin-bottom: 6px;
}

.privacy-text p {
  margin: 10px 0;
  text-align: justify;
}

.privacy-text a {
  color: #1e3a8a;
  text-decoration: underline;
}

/* Поле ввода ФИО — на всю ширину */
.start-form input[type="text"] {
  display: block;
  width: 100%;
  padding: 14px 16px;              /* было 12 */
  font-size: 1.05rem;              /* было 1rem — чуть крупнее */
  line-height: 1.4;
  border: 2px solid var(--gray);
  border-radius: 10px;             /* было 8 */
  background: #fff;
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.start-form input[type="text"]:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, .15);
}

/* Чекбокс согласия — компактный */
.start-form input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
}