/* Partner page for Malkovskaya СОШ — portal-like trust, dual branding */

.ms-body {
  --ms-navy: #1a3a6b;
  --ms-navy-deep: #12284a;
  --ms-orange: #e87722;
  --ms-yellow: #f0c040;
  --ms-bg: #f4f7fb;
  --ms-paper: #ffffff;
  --ms-text: #1a2b44;
  --ms-muted: #5a6b85;
  --ms-border: #c5d0e0;
  --ms-full: #9aa5b5;
  --ms-radius: 6px;
  --ms-font: "Roboto", "Inter", "Segoe UI", system-ui, sans-serif;
  margin: 0;
  color: var(--ms-text);
  background: var(--ms-bg);
  font-family: var(--ms-font);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ms-body a { color: var(--ms-navy); }

.ms-shell {
  flex: 1;
  background-color: var(--ms-bg);
  background-image:
    linear-gradient(rgba(26, 58, 107, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 58, 107, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

.ms-container {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.ms-identity {
  background: var(--ms-paper);
  border-bottom: 1px solid var(--ms-border);
  padding: 16px 0;
}

.ms-identity__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: nowrap;
}

.ms-brands {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
}

.ms-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.ms-brand img {
  display: block;
  object-fit: contain;
}

.ms-brand--primary .ms-brand__text strong {
  font-size: 18px;
}

.ms-brand--primary .ms-brand__text span {
  font-size: 13px;
  color: var(--ms-navy);
  font-weight: 600;
}

.ms-brand--school img { width: 44px; height: auto; max-height: 64px; }
.ms-brand--liga img { width: 56px; height: 56px; }

.ms-gerb {
  display: block;
  width: 48px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.ms-identity__cta {
  flex-shrink: 0;
  white-space: nowrap;
}

.ms-brand__text strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  color: var(--ms-navy-deep);
}

.ms-brand__text span {
  display: block;
  font-size: 12px;
  color: var(--ms-muted);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .ms-identity__inner,
  .ms-brands {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .ms-identity {
    padding: 12px 0;
  }

  .ms-identity__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .ms-identity__cta {
    display: none;
  }

  .ms-brands {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "liga liga"
      "school gerb";
    align-items: center;
    gap: 10px 12px;
  }

  .ms-brand--liga {
    grid-area: liga;
    min-width: 0;
  }

  .ms-brand--school {
    grid-area: school;
    min-width: 0;
  }

  .ms-gerb {
    grid-area: gerb;
    width: 40px;
    justify-self: end;
  }

  .ms-brand--liga img { width: 48px; height: 48px; }
  .ms-brand--school img { width: 36px; max-height: 52px; }

  .ms-brand--primary .ms-brand__text strong { font-size: 16px; }
  .ms-brand--primary .ms-brand__text span {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ms-brand--school .ms-brand__text strong { font-size: 13px; }
  .ms-brand--school .ms-brand__text span { font-size: 11px; }
}

.ms-nav {
  background: var(--ms-navy);
  padding: 0;
}

.ms-nav__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.ms-nav a,
.ms-nav__btn {
  flex: 1 1 0;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  padding: 10px 2px;
  font-size: clamp(0.58rem, 2.2vw, 0.78rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
}

.ms-nav a:hover,
.ms-nav a.is-active,
.ms-nav__btn:hover {
  background: var(--ms-orange);
  color: #fff;
}

.ms-main { padding: 28px 0 48px; }

.ms-hero {
  background: var(--ms-paper);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.ms-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  color: var(--ms-navy-deep);
  line-height: 1.25;
}

.ms-hero__photo {
  margin: 12px 0 16px;
  border-radius: var(--ms-radius);
  overflow: hidden;
  border: 1px solid var(--ms-border);
  background: #e8eef6;
}

.ms-hero__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  vertical-align: middle;
}

.ms-hero p {
  margin: 0 0 12px;
  color: var(--ms-muted);
  max-width: 52rem;
}

.ms-hero__place {
  margin: 4px 0 14px !important;
  padding: 10px 14px;
  background: #eef4fb;
  border-left: 4px solid var(--ms-navy);
  color: var(--ms-navy-deep) !important;
  font-weight: 600;
}

.ms-hero__place strong {
  color: #b42318;
  font-weight: 800;
  white-space: nowrap;
}

.ms-hero__place a {
  font-weight: 700;
  margin-left: 4px;
}

.ms-hero__discount {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 8px 14px;
  background: #fff4e8;
  border-left: 4px solid var(--ms-orange);
  color: var(--ms-navy-deep);
  font-weight: 700;
}

.ms-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  background: var(--ms-navy);
  color: #fff !important;
  text-decoration: none;
  border: 2px solid var(--ms-navy);
  border-radius: var(--ms-radius);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.ms-btn:hover { background: var(--ms-navy-deep); border-color: var(--ms-navy-deep); }

.ms-btn--ghost {
  background: #fff;
  color: var(--ms-navy) !important;
}

.ms-btn--ghost:hover { background: #eef3fa; }

.ms-btn:disabled,
.ms-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ms-section {
  background: var(--ms-paper);
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.ms-section h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--ms-navy-deep);
  border-bottom: 3px solid #f0c040;
  display: inline-block;
  padding-bottom: 4px;
}

.ms-section__note {
  margin: 8px 0 16px;
  color: var(--ms-muted);
  font-size: 14px;
}

.ms-schedule {
  display: grid;
  gap: 8px;
}

.ms-schedule-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: #fafcfe;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.ms-schedule-row:hover:not(:disabled) {
  border-color: var(--ms-navy);
  background: #eef3fa;
}

.ms-schedule-row.is-full,
.ms-schedule-row:disabled {
  opacity: 0.72;
  background: #eef1f5;
  color: var(--ms-full);
  cursor: not-allowed;
}

.ms-schedule-row__code {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ms-navy);
}

.ms-schedule-row.is-full .ms-schedule-row__code { color: var(--ms-full); }

.ms-schedule-row__main strong { display: block; }
.ms-schedule-row__slot { font-size: 14px; color: var(--ms-muted); }
.ms-schedule-row__badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.ms-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ms-price-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 14px;
  background: #fafcfe;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ms-price-card--featured {
  border-color: var(--ms-navy);
  background: #f3f7fc;
}

.ms-price-card:hover,
.ms-price-card:focus-visible {
  border-color: var(--ms-navy);
  background: #fff;
  box-shadow: 0 2px 10px rgba(18, 40, 74, 0.08);
  outline: none;
}

.ms-price-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ms-navy-deep);
  line-height: 1.25;
}

.ms-price-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.ms-price-card__lessons {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ms-muted);
}

.ms-price-card__was {
  text-decoration: line-through;
  color: var(--ms-muted);
  font-size: 15px;
}

.ms-price-card__deal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-top: 10px;
}

.ms-price-card__now {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ms-navy-deep);
}

.ms-price-card__save {
  font-size: 1.05rem;
  font-weight: 800;
  color: #c45a00;
  letter-spacing: 0.01em;
}

.ms-price-card__per { margin: 8px 0 0; font-size: 13px; color: var(--ms-muted); }

.ms-map-wrap {
  position: relative;
  margin-top: 12px;
}

.ms-map {
  position: relative;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  overflow: hidden;
  background: #e8eef6;
  min-height: 404px;
}

.ms-map iframe {
  display: block;
  width: 100%;
  min-height: 404px;
  height: 404px;
  border: 0;
  max-width: 100%;
}

.ms-map > ymaps,
.ms-map > div {
  width: 100% !important;
  min-height: 404px;
}

.ms-map-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  font-size: 14px;
}

.ms-map-vpn-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--ms-radius);
  background: #fff4e8;
  border-left: 4px solid var(--ms-orange);
  color: var(--ms-navy-deep);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.ms-map-vpn-hint[hidden] {
  display: none !important;
}

.ms-map-placeholder {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 24px;
  color: var(--ms-muted);
  text-align: center;
}

.ms-branch-list {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  gap: 10px;
  max-width: min(320px, calc(100% - 32px));
  pointer-events: none;
}

.ms-branch-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--ms-radius);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--ms-border);
  box-shadow: 0 4px 16px rgba(18, 40, 74, 0.1);
  pointer-events: auto;
}

.ms-branch-card__num {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ms-navy);
}

.ms-branch-card__body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ms-navy-deep);
}

.ms-branch-card__body p {
  margin: 0;
  color: var(--ms-muted);
  font-size: 14px;
  line-height: 1.4;
}

.ms-form-card {
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 18px;
  background: #fafcfe;
}

.ms-form-section {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.ms-form-section legend {
  font-weight: 700;
  color: var(--ms-navy-deep);
  margin-bottom: 10px;
  padding: 0;
}

.ms-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ms-field { display: flex; flex-direction: column; gap: 4px; }
.ms-field--full { grid-column: 1 / -1; }

.ms-field label { font-size: 13px; font-weight: 600; }
.ms-field input,
.ms-field select,
.ms-field textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: #fff;
}

.ms-field textarea { min-height: 80px; resize: vertical; }

.ms-slots {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.ms-slot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: #fff;
  cursor: pointer;
}

.ms-slot input { margin-top: 3px; }

.ms-slot.is-full {
  background: #e8ecf1;
  color: var(--ms-full);
  cursor: not-allowed;
  border-style: dashed;
}

.ms-slot.is-full input { pointer-events: none; }

.ms-slot__title { font-weight: 700; }
.ms-slot__meta { font-size: 13px; color: var(--ms-muted); }
.ms-slot.is-full .ms-slot__meta { color: var(--ms-full); }

.ms-slot-empty {
  padding: 12px;
  color: var(--ms-muted);
  font-size: 14px;
}

.ms-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  margin: 8px 0;
}

.ms-errors {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #8a1f11;
  padding: 12px 14px;
  border-radius: var(--ms-radius);
  margin-bottom: 14px;
}

.ms-errors.is-hidden,
.ms-errors[hidden] {
  display: none;
}

.ms-field.has-error input,
.ms-field.has-error select,
.ms-slots.has-error {
  border-color: #c0392b;
}

.ms-check.has-error {
  color: #8a1f11;
}

.ms-field-error {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  color: #8a1f11;
}

.ms-field.has-error .ms-field-error,
.ms-field-error:not(:empty) {
  display: block;
}

.ms-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ms-muted);
}

.ms-footer {
  background: var(--ms-navy-deep);
  color: #d7e0ef;
  padding: 24px 0;
  font-size: 13px;
}

.ms-footer a { color: #fff; }
.ms-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.ms-footer strong { color: #fff; }
.ms-footer__credit {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: 0.85;
}
.ms-footer__credit a { text-decoration: underline; }

.ms-required { color: #b42318; }

.ms-dock {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--ms-border);
  padding: 12px 0;
  backdrop-filter: blur(8px);
}

.ms-dock__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ms-dock__hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--ms-navy-deep);
}

.ms-modal {
  border: 0;
  padding: 0;
  max-width: min(640px, calc(100vw - 24px));
  width: 100%;
  border-radius: 10px;
  background: transparent;
}

.ms-modal::backdrop {
  background: rgba(18, 40, 74, 0.55);
}

.ms-modal__card {
  background: #fff;
  border: 1px solid var(--ms-border);
  border-radius: 10px;
  padding: 18px 18px 16px;
  max-height: min(88vh, 900px);
  overflow: auto;
}

.ms-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ms-modal__head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ms-navy-deep);
}

.ms-modal__close {
  border: 0;
  background: #eef3fa;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ms-navy);
}

.ms-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.ms-main { padding-bottom: 24px; }

@media (max-width: 720px) {
  .ms-schedule-row {
    grid-template-columns: 56px 1fr;
  }
  .ms-schedule-row__badge { grid-column: 2; }
  .ms-field-grid { grid-template-columns: 1fr; }
  .ms-footer__grid { grid-template-columns: 1fr; }
  .ms-nav a,
  .ms-nav__btn { padding: 10px 2px; }
  .ms-dock__hint { font-size: 13px; }
  .ms-branch-list {
    position: static;
    max-width: none;
    margin-top: 12px;
  }
  .ms-map {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .ms-map iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }
  .ms-map > ymaps,
  .ms-map > div {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }
  .ms-hero__place strong { white-space: normal; }
}

/* Плавающий виджет Max (правый нижний угол) */
.ms-max-widget {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--ms-navy-deep);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  box-shadow: 0 10px 28px rgba(15, 42, 74, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ms-max-widget:hover,
.ms-max-widget:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 42, 74, 0.28);
  outline: none;
}

.ms-max-widget__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.ms-max-widget__text {
  padding-right: 4px;
}

body.ms-signup-open .ms-max-widget {
  visibility: hidden;
  pointer-events: none;
}

/* Блок контактов на странице */
.ms-contacts-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 20px 28px;
  padding: 18px 16px;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  background: #fafcfe;
}

.ms-contacts-block__info p {
  margin: 0 0 12px;
  line-height: 1.45;
}

.ms-contacts-block__info p:last-child {
  margin-bottom: 0;
}

.ms-contacts-block__info a {
  color: var(--ms-navy);
  font-weight: 700;
  text-decoration: none;
}

.ms-contacts-block__info a:hover {
  text-decoration: underline;
}

.ms-contacts-block__channels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ms-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--ms-border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ms-channel:hover,
.ms-channel:focus-visible {
  border-color: var(--ms-navy);
  box-shadow: 0 2px 10px rgba(18, 40, 74, 0.08);
  outline: none;
}

.ms-channel img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ms-channel span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ms-channel strong {
  color: var(--ms-navy-deep);
  font-size: 0.95rem;
}

.ms-muted {
  color: var(--ms-muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .ms-max-widget {
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    padding: 0;
    width: 52px;
    height: 52px;
    justify-content: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .ms-max-widget__icon {
    width: 52px;
    height: 52px;
  }
  .ms-max-widget__text {
    display: none;
  }
  .ms-contacts-block {
    grid-template-columns: 1fr;
  }
}

/* legacy aliases removed: old multi-item floating contacts */
