/* ============================================================
   УралГУФК · Подготовка пакета документов слушателя
   Полный style.css
   ============================================================ */

:root {
  --brand: #0a4d8c;
  --brand-dark: #073a6b;
  --brand-light: #e8f1f9;
  --accent: #c8102e;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --bg: #f3f6fa;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(10, 77, 140, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ============================================================
   Header
   ============================================================ */

.header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--white);
  padding: 28px 16px 32px;
}

.header__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.header__logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.header__logo strong {
  font-size: 16px;
  font-weight: 700;
}

.header__logo span {
  opacity: 0.9;
}

.header__title {
  margin: 18px 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.header__subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 15px;
}

/* ============================================================
   Container
   ============================================================ */

.container {
  max-width: 1100px;
  margin: -18px auto 40px;
  padding: 0 16px;
}

/* ============================================================
   Card
   ============================================================ */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card__title {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--brand-dark);
  border-bottom: 2px solid var(--brand-light);
  padding-bottom: 8px;
}

.card--result {
  border-left: 4px solid var(--brand);
}

.card--result h2.card__title {
  border-bottom-color: #b8e0c5;
}

/* ============================================================
   Form grid и поля
   ============================================================ */

.form .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.field--full { grid-column: 1 / -1; }

.field > span {
  font-weight: 600;
  color: var(--brand-dark);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"],
.field input[type="number"],
.field input[type="file"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fbfdff;
}

.field input[type="file"] {
  padding: 8px 12px;
  background: var(--white);
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.15);
  background: var(--white);
}

.field input:invalid:not(:placeholder-shown) {
  border-color: var(--accent);
}

/* ============================================================
   Radio-группа (Пол)
   ============================================================ */

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 8px 0;
  flex-wrap: wrap;
}

.radio-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
}

.radio-item input {
  margin: 0;
  cursor: pointer;
  padding: 0;
  width: auto;
}

.radio-item span {
  font-weight: 400;
  color: var(--text);
}

/* ============================================================
   Select (Область)
   ============================================================ */

.field-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfdff;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.15);
  background: var(--white);
}

/* ============================================================
   Photo
   ============================================================ */

.photo-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.photo-preview {
  width: 120px;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #fafbfc;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-label { display: inline-block; cursor: pointer; }
.file-label input { display: none; }

.file-label span {
  display: inline-block;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--white);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.file-label span:hover { background: var(--brand-dark); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--brand);
  color: var(--white);
}
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary:disabled {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn--ghost:hover { background: var(--brand-light); }

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ============================================================
   Hint
   ============================================================ */

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.hint--center {
  text-align: center;
  margin-top: 16px;
}

/* ============================================================
   Downloads
   ============================================================ */

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--brand-light);
  border-radius: 10px;
  text-decoration: none;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s, transform 0.1s;
  border: 1px solid transparent;
  cursor: pointer;
}

.download-item:hover {
  background: #d6e6f4;
  transform: translateY(-1px);
}

.download-item::before {
  content: "📄";
  font-size: 20px;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 20px 16px;
  font-size: 13px;
}

.footer p { margin: 4px 0; }

/* ============================================================
   Admin
   ============================================================ */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
  background: var(--white);
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table tr:nth-child(even) td {
  background: #fafbfc;
}

.admin-table tr:hover td {
  background: #eef5fb;
}

.admin-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.folder-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.folder-link:hover { text-decoration: underline; }

/* ---------- Фильтр в admin.php ---------- */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
}

.filter-row__select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfdff;
  min-width: 280px;
  max-width: 100%;
  cursor: pointer;
}

.filter-row__select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.15);
  background: var(--white);
}

/* ---------- Кнопка скачивания ZIP в админке ---------- */
.btn-zip {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-zip:hover { background: var(--brand-dark); }

.btn-zip:disabled {
  background: var(--muted);
  cursor: wait;
  opacity: 0.8;
}

.row-photo {
  max-width: 60px;
  max-height: 80px;
  display: block;
  border-radius: 4px;
  margin-bottom: 6px;
}

.docs-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-cell a {
  color: var(--brand);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.docs-cell a:hover { text-decoration: underline; }

/* ---------- Ячейка документов: разделитель и метки ---------- */

.docs-cell__sep {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 4px 0;
}

.docs-cell__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.docs-cell__label--ok {
  color: #0b7a3d;
}

.docs-cell__label--pending {
  color: #b06b00;
}

.docs-cell__hint {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* ============================================================
   Задел под генерацию документов (кнопки приказов)
   ============================================================ */

.doc-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ============================================================
   Блок персональной ссылки на форму upload-signed.php
   ============================================================ */

.upload-link-block {
  margin-top: 24px;
  padding: 20px;
  background: #fff8e1;
  border-left: 4px solid #f6a800;
  border-radius: 8px;
}

.upload-link-block__title {
  margin: 0 0 8px;
  font-size: 17px;
  color: #7a4e00;
}

.upload-link-block__text {
  margin: 0 0 14px;
  color: #6b5024;
  font-size: 14px;
  line-height: 1.5;
}

.upload-link-block__row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.upload-link-block__input {
  flex: 1 1 320px;
  padding: 10px 12px;
  border: 1px solid #d9b96b;
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
  background: #fffdf5;
  color: var(--text);
}

.upload-link-block__input:focus {
  outline: none;
  border-color: #f6a800;
  box-shadow: 0 0 0 3px rgba(246, 168, 0, 0.2);
}

.upload-link-block__hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #7a4e00;
}

/* ============================================================
   Страница загрузки подписанных (upload-signed.php)
   ============================================================ */

.error-text {
  color: var(--accent);
  font-weight: 600;
  padding: 12px 16px;
  background: #fdecef;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
}

details summary {
  cursor: pointer;
  padding: 8px 0;
  color: var(--brand);
  font-weight: 600;
  user-select: none;
}

details summary:hover {
  text-decoration: underline;
}

details[open] summary {
  margin-bottom: 8px;
}

/* ============================================================
   Адаптивность
   ============================================================ */

@media (max-width: 720px) {
  .form .grid { grid-template-columns: 1fr; }
  .header__title { font-size: 22px; }
  .card { padding: 18px; }
  .photo-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .photo-controls { align-items: center; }
  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-row__select {
    width: 100%;
    min-width: 0;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .actions .btn { width: 100%; }
  .upload-link-block__row {
    flex-direction: column;
    align-items: stretch;
  }
  .upload-link-block__input { width: 100%; }
}