:root {
  --blue: #0b5cab;
  --blue-dark: #0d2c54;
  --blue-hover: #094a8c;
  --accent: #1592d3;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --text: #1f2a37;
  --muted: #6b7684;
  --border: #dde5ee;
  --green: #1a8f4c;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(13, 44, 84, 0.10);
}

* { box-sizing: border-box; }

html {
  /* Не даём iOS/Safari самовольно увеличивать шрифты в альбомной ориентации */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: -webkit-sticky; position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--blue-dark); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 8px;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 18px;
  letter-spacing: .5px;
}
.brand-logo { height: 46px; width: auto; }
.brand-text { font-weight: 600; font-size: 15px; color: var(--blue-dark); }
.header-cta {
  background: var(--blue); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.header-cta:hover { background: var(--blue-hover); text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff; padding: 72px 0;
  background-size: cover; background-position: center;
}
.hero-inner { max-width: 760px; }
.hero-title { font-size: 44px; margin: 0 0 14px; line-height: 1.1; font-weight: 800; }
.hero-subtitle { font-size: 20px; margin: 0 0 28px; opacity: .95; }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 30px; margin: 0 0 28px; color: var(--blue-dark); text-align: center;
}

.lead-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 32px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto;
}
.lead-text { font-size: 17px; margin: 0 0 18px; }
.participation {
  margin: 0; font-weight: 700; color: var(--green);
  background: #eaf7ef; border-left: 4px solid var(--green);
  padding: 12px 16px; border-radius: 6px;
}

/* Schedule */
.schedule {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.schedule-head, .schedule-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 1.1fr 150px 160px;
  align-items: center; gap: 12px; padding: 14px 20px;
}
.schedule-head {
  background: var(--blue-dark); color: #fff; font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .3px;
}
.schedule-row { border-top: 1px solid var(--border); font-size: 16px; }
.schedule-row:nth-child(even) { background: #fafcfe; }
.schedule-empty { padding: 24px; text-align: center; color: var(--muted); }
.program-link { font-weight: 600; }
.program-pending { color: var(--muted); font-style: italic; }
.col-action { text-align: center; }
.schedule-head .col-action { font-size: 12px; line-height: 1.25; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer; border: none; border-radius: 8px;
  font-weight: 600; font-size: 15px; padding: 10px 18px; transition: background .15s;
  font-family: inherit; -webkit-appearance: none; appearance: none;
  text-align: center;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); text-decoration: none; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-register, .btn-participate { padding: 9px 16px; }
.col-action .btn { width: 100%; }
.btn-link {
  background: none; color: var(--blue); padding: 6px 0; font-size: 14px;
}
.btn-link:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  background: var(--blue-dark); color: #cdd8e8; padding: 26px 0; margin-top: 20px;
  font-size: 14px; text-align: center;
}

/* Modal */
.modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: rgba(13, 44, 84, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Атрибут hidden должен побеждать display:flex выше */
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 480px;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 28px; line-height: 1; color: #fff; cursor: pointer; opacity: .9;
}
.modal-close:hover { opacity: 1; }
.modal-header {
  background: var(--blue); color: #fff; padding: 22px 26px; border-radius: 12px 12px 0 0;
}
.modal-header h3 { margin: 0 0 4px; font-size: 20px; }
.modal-sub { margin: 0; opacity: .95; font-size: 15px; }
.modal-body { padding: 22px 26px 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 16px; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,92,171,.12); }
.fio-item { margin-bottom: 8px; }
.req { color: #d33; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }

.form-message { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.form-message.error { background: #fdecec; color: #b3261e; border: 1px solid #f5c2c0; }
.form-message.success { background: #eaf7ef; color: #1a8f4c; border: 1px solid #b6e2c6; }

/* Responsive */

/* Планшеты и уже: раскладываем таблицу расписания в карточки,
   чтобы 6 колонок не сплющивались на узких экранах (напр. iPad портрет 768px). */
@media (max-width: 900px) {
  .schedule-head { display: none; }
  .schedule-row {
    grid-template-columns: 1fr; gap: 6px; padding: 16px 18px;
  }
  .schedule-row > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .schedule-row > div[data-label]::before {
    content: attr(data-label); font-weight: 600; color: var(--muted); margin-right: 12px;
  }
  .col-action {
    flex-direction: column; align-items: stretch; text-align: left; margin-top: 8px;
  }
  .col-action[data-label]::before { margin: 0 0 6px; color: var(--blue-dark); }
  .col-action .btn { width: 100%; }
}

/* Телефоны */
@media (max-width: 760px) {
  .hero { padding: 52px 0; }
  .hero-title { font-size: 32px; }
  .hero-subtitle { font-size: 18px; }
  .brand-text { display: none; }
  .section { padding: 40px 0; }
  .section-title { font-size: 24px; }
  .lead-card { padding: 22px 20px; }
  .lead-text { font-size: 16px; }
  .modal-overlay { padding: 20px 12px; }
}

/* Небольшие телефоны (iPhone SE, старые Android) */
@media (max-width: 400px) {
  .container { padding: 0 14px; }
  .hero-title { font-size: 27px; }
  .hero-subtitle { font-size: 16px; }
  .header-cta { padding: 9px 12px; font-size: 13px; }
  .brand-mark { width: 40px; height: 40px; font-size: 16px; }
  .section-title { font-size: 22px; }
}
