/* ═══════════════════════════════════════════════════════════
   Principles list · course index table · Germany routes ·
   testimonials · team · pricing · steps · FAQ · apply form
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════ PRINCIPLES (why) ═══════════════ */
.prin {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.prin__i {
  padding: clamp(1.4rem, 1.1rem + 1vw, 2.2rem) clamp(1rem, .6rem + 1.4vw, 2rem) clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem) 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--d) var(--e-out);
}
.prin__i:not(:nth-child(3n+1)) {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1rem, .6rem + 1.6vw, 2rem);
}
.prin__n { display: block; margin-bottom: 1rem; color: var(--violet); }
.prin__i h3 { font-size: var(--t-lg); margin-bottom: .6rem; }
.prin__i p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.6; max-width: 40ch; }

/* ═══════════════ COURSE INDEX TABLE ═══════════════ */
/* No top rule here: the section header already closes with one, and the tabs
   that used to sit between them are gone. */
.idx { font-size: var(--t-sm); }

.idx tbody tr {
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--d) var(--e-out);
}
.idx tbody tr:hover { background: var(--violet-wash); }

.idx td {
  padding: clamp(1rem, .8rem + .6vw, 1.5rem) 1rem clamp(1rem, .8rem + .6vw, 1.5rem) 0;
  vertical-align: top;
}
.idx td.idx__n { color: var(--ink-3); width: 52px; font-size: var(--t-xs); padding-top: 1.35rem; }
.idx td.idx__lv {
  width: 108px;
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--violet);
  letter-spacing: .04em;
  padding-top: 1.3rem;
  white-space: nowrap;
}
.idx__name { min-width: 260px; }
.idx__name b {
  display: block;
  font-size: var(--t-xl);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  transition: color var(--d) var(--e-out);
}
.idx tbody tr:hover .idx__name b { color: var(--violet); }
.idx__name span {
  display: block;
  margin-top: .45rem;
  max-width: 52ch;
  color: var(--ink-2);
  line-height: 1.55;
}
.idx__tag {
  display: inline-block;
  margin-top: .7rem;
  padding: .22rem .5rem;
  font-family: var(--f-mono);
  font-style: normal;
  font-size: var(--t-2xs);
  letter-spacing: .07em;
  text-transform: uppercase;
  background: var(--violet);
  color: #fff;
  border-radius: var(--r-sm);
}
.idx__tag--alt { background: var(--ink); }

.idx td.idx__dur {
  width: 132px;
  color: var(--ink-2);
  font-size: var(--t-xs);
  padding-top: 1.3rem;
  white-space: nowrap;
}
.idx td.idx__go { width: 48px; padding-right: 0; padding-top: 1.15rem; }
.idx__tg {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  color: var(--ink);
  transition: background-color var(--d) var(--e-out), color var(--d) var(--e-out),
              border-color var(--d) var(--e-out);
}
.idx__tg .ic { transition: transform var(--d-slow) var(--e-out); }
.idx tbody tr:hover .idx__tg { background: var(--violet); border-color: var(--violet); color: #fff; }
.idx__tg[aria-expanded="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.idx__tg[aria-expanded="true"] .ic { transform: rotate(135deg); }

/* ── Expanded detail row ──────────────────────────────── */
.idx td.idx-det-cell { padding: 0; }
.pc-det[hidden] { display: none; }
.idx tbody tr.pc-det:hover { background: transparent; }
.pc-det .det {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0 1.6rem 52px;
  animation: detIn var(--d-slow) var(--e-out);
}
@keyframes detIn { from { opacity: 0; transform: translateY(-6px); } }
.det__list { display: grid; gap: .55rem; }
.det__list li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.det__list .ic { color: var(--violet); margin-top: .25em; }

/* ═══════════════ GERMANY ROUTES ═══════════════ */
.ways { border-top: 1px solid var(--rule); }
.way {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 170px;
  gap: clamp(1rem, .6rem + 1.6vw, 2.5rem);
  align-items: start;
  padding-block: clamp(1.5rem, 1.1rem + 1.4vw, 2.4rem);
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--d) var(--e-out);
}
.way:hover { background: var(--violet-wash); }
.way__n {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--rule-2);
  transition: color var(--d) var(--e-out);
}
.way:hover .way__n { color: var(--violet); }
.way h3 { font-size: var(--t-2xl); margin-bottom: .5rem; }
.way p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.6; max-width: 54ch; }
.way__req {
  justify-self: end;
  padding: .35rem .7rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  color: var(--ink-2);
  white-space: nowrap;
}

/* ── Route rule ───────────────────────────────────────── */
.route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.route__svg { width: 100%; height: 76px; overflow: visible; }
.route__line {
  stroke: var(--violet);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  opacity: .8;
}
.route__lbl { color: var(--ink-2); }
.route__lbl--b { color: var(--violet); }

/* ═══════════════ TESTIMONIALS ═══════════════ */
.tslider { position: relative; }
.tslider__vp { overflow: hidden; }
.tslider__track {
  display: flex;
  gap: clamp(1rem, .6rem + 1.4vw, 2rem);
  transition: transform var(--d-slow) var(--e-out);
  will-change: transform;
}
.tq {
  flex: 0 0 auto;
  width: calc((100% - 2 * clamp(1rem, .6rem + 1.4vw, 2rem)) / 3);
  display: flex;
  flex-direction: column;
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}
.tq__q { width: 22px; height: 22px; fill: var(--violet); margin-bottom: 1rem; }
.tq blockquote {
  font-size: var(--t-lg);
  line-height: 1.5;
  letter-spacing: -.015em;
  color: var(--ink);
}
.tq figcaption {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: auto;
  padding-top: 1.4rem;
}
.tq figcaption b { font-size: var(--t-sm); font-weight: 600; }
.tq figcaption span { color: var(--ink-3); }

.tslider__nav { display: flex; align-items: center; gap: .6rem; margin-top: 2rem; }
.rbtn {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  color: var(--ink);
  transition: background-color var(--d) var(--e-out), color var(--d) var(--e-out),
              border-color var(--d) var(--e-out), opacity var(--d) var(--e-out);
}
.rbtn:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rbtn:disabled { opacity: .28; cursor: not-allowed; }
#tPrev .ic { transform: rotate(90deg); }
#tNext .ic { transform: rotate(-90deg); }
.tslider__dots { display: flex; gap: .35rem; margin-left: auto; }
.tslider__dots button {
  width: 22px; height: 2px;
  background: var(--rule-2);
  transition: background-color var(--d) var(--e-out);
}
.tslider__dots button.is-on { background: var(--violet); }

/* ═══════════════ TEAM ═══════════════ */
.team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, .8rem + 2vw, 3rem);
}
.tm { display: flex; flex-direction: column; }
.tm__av {
  position: relative;
  aspect-ratio: 4 / 5;
  margin-bottom: 1.2rem;
  background:
    linear-gradient(180deg, var(--violet-tint), var(--paper-3));
  border: 1px solid var(--rule);
  overflow: hidden;
}
.tm__av img,
.st__av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.tm__av[data-ini]::after {
  content: attr(data-ini);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4.5rem);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--violet);
  opacity: .55;
}
.tm h3 { font-size: var(--t-lg); }
.tm__role { margin-top: .4rem; color: var(--violet); }
.tm__bio { margin-top: .8rem; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.6; }

.team-sub {
  margin: clamp(2.4rem, 1.8rem + 2vw, 3.6rem) 0 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
}
.staff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, .8rem + 2vw, 3rem);
}
.st { display: flex; align-items: flex-start; gap: 1.2rem; }
.st__tx { padding-top: .4rem; }
.st__av {
  position: relative;
  flex: none;
  width: clamp(88px, 70px + 3vw, 120px);
  aspect-ratio: 4 / 5;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.st h3 { font-size: var(--t-lg); }
.st__ph { display: flex; flex-direction: column; gap: .2rem; margin-top: .6rem; font-size: var(--t-sm); }
.st__ph a { color: var(--ink-2); text-decoration: none; }
.st__ph a:hover { color: var(--violet); }

/* ═══════════════ PRICING ═══════════════ */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.pl {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 1.2rem + 1.2vw, 2.4rem) clamp(1rem, .7rem + 1.4vw, 2rem) clamp(1.5rem, 1.2rem + 1vw, 2.2rem) 0;
}
.pl + .pl { border-left: 1px solid var(--rule); padding-left: clamp(1rem, .7rem + 1.6vw, 2rem); }
.pl--hot { background: var(--violet-wash); padding-left: clamp(1rem, .7rem + 1.6vw, 2rem); padding-right: clamp(1rem, .7rem + 1.4vw, 2rem); }
.pl__flag {
  align-self: flex-start;
  margin-bottom: .8rem;
  padding: .25rem .55rem;
  background: var(--violet);
  color: #fff;
  border-radius: var(--r-sm);
}
.pl h3 { font-size: var(--t-xl); }
.pl__d { margin-top: .35rem; font-size: var(--t-sm); color: var(--ink-3); }
.pl__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.3rem 0 1.4rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--rule);
}
.pl__price b {
  font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
}
.pl--hot .pl__price b { color: var(--violet); }
.pl ul { display: grid; gap: .6rem; margin-bottom: 1.8rem; }
.pl ul li, .apply__list li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: var(--t-sm);
  color: var(--ink-2);
  line-height: 1.5;
}
.pl ul .ic, .apply__list .ic { color: var(--violet); margin-top: .28em; }
.pl .btn { margin-top: auto; }


/* ═══════════════ FAQ ═══════════════ */
.acc { border-top: 1px solid var(--ink); }
.ac { border-bottom: 1px solid var(--rule); }
.ac summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.1rem, .9rem + .6vw, 1.5rem) 0;
  cursor: pointer;
  list-style: none;
  font-size: var(--t-lg);
  font-weight: 500;
  letter-spacing: -.018em;
  transition: color var(--d) var(--e-out);
}
.ac summary:hover { color: var(--violet); }
.ac summary .ic { flex: 0 0 auto; color: var(--violet); transition: transform var(--d-slow) var(--e-out); }
.ac[open] summary .ic { transform: rotate(135deg); }
.ac__b {
  padding: 0 0 1.5rem;
  /* The `ch` unit under-constrains real text badly here, and Latin (kaa/uz)
     packs ~13% more characters per line than Cyrillic. Tuned against the
     widest of the three languages, not against ru. */
  max-width: 52ch;
  font-size: var(--t-sm);
  color: var(--ink-2);
  line-height: 1.72;
}
.ac[open] .ac__b { animation: accIn var(--d-slow) var(--e-out); }
@keyframes accIn { from { opacity: 0; transform: translateY(-6px); } }

/* ═══════════════ APPLY ═══════════════ */
.apply { background: var(--paper-2); border-top: 1px solid var(--rule); }
.apply__in {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 1.2rem + 3.5vw, 5rem);
  align-items: start;
}
.apply__h { font-size: var(--t-2xl); }
.apply__p { margin-top: 1rem; font-size: var(--t-base); color: var(--ink-2); line-height: 1.6; max-width: 40ch; }
.apply__art { width: min(100%, 300px); height: auto; margin-top: 2rem; }
.apply__list { display: grid; gap: .65rem; margin-top: 1.8rem; }
.apply__contact { display: grid; gap: 0; margin-top: 2.2rem; border-top: 1px solid var(--rule-2); }
.cbtn {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-2);
  transition: padding-left var(--d) var(--e-out);
}
.cbtn:hover { padding-left: .5rem; }
.cbtn .ic { color: var(--violet); }
.cbtn span { display: flex; flex-direction: column; line-height: 1.3; }
.cbtn b { font-size: var(--t-sm); font-weight: 600; }
.cbtn i { font-style: normal; font-size: var(--t-xs); color: var(--ink-3); }
.cbtn__go { margin-left: auto; color: var(--ink-3) !important; }

/* ── Form ─────────────────────────────────────────────── */
.apply__formwrap {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: clamp(1.4rem, 1.1rem + 1.6vw, 2.6rem);
}
.form { display: grid; gap: 1.3rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.fld { display: grid; gap: .45rem; min-width: 0; }
.fld label, .fld .lbl {
  font-family: var(--f-mono);
  font-size: var(--t-2xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fld input, .fld textarea, .fld select {
  width: 100%;
  padding: .7rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--t-base);
  transition: border-color var(--d) var(--e-out);
}
.fld textarea { resize: vertical; min-height: 52px; line-height: 1.55; }
.fld input::placeholder, .fld textarea::placeholder { color: var(--ink-3); }
.fld input:hover, .fld textarea:hover, .sel:hover select { border-bottom-color: var(--ink-3); }
.fld input:focus, .fld textarea:focus, .fld select:focus {
  outline: none;
  border-bottom-color: var(--violet);
  border-bottom-width: 2px;
  padding-bottom: calc(.7rem - 1px);
}
.fld input.is-bad, .fld textarea.is-bad { border-bottom-color: #C0271E; }

.sel { position: relative; }
.sel select { appearance: none; -webkit-appearance: none; padding-right: 1.8rem; cursor: pointer; }
.sel .ic { position: absolute; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-3); }

.err { display: none; font-size: var(--t-xs); color: #C0271E; }
.err.is-on { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .5rem 1rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  font-size: var(--t-sm);
  color: var(--ink-2);
  transition: border-color var(--d) var(--e-out), background-color var(--d) var(--e-out), color var(--d) var(--e-out);
}
.chip:hover span { border-color: var(--ink-3); color: var(--ink); }
.chip input:checked + span { border-color: var(--violet); background: var(--violet); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

.form__legal { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }

.done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding-block: 1rem;
}
.done[hidden] { display: none; }
.done__ic {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border: 1px solid var(--violet);
  border-radius: 50%;
  color: var(--violet);
}
.done h3 { font-size: var(--t-xl); }
.done p { font-size: var(--t-sm); color: var(--ink-2); max-width: 44ch; line-height: 1.6; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 1080px) {
  .prin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prin__i:not(:nth-child(3n+1)) { border-left: 0; padding-left: 0; }
  .prin__i:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 1.5rem; }
  .tq { width: calc((100% - clamp(1rem, .6rem + 1.4vw, 2rem)) / 2); }
  .apply__in { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .pl + .pl { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
  .pl--hot { padding-left: clamp(1rem, .7rem + 1.6vw, 2rem); }
}

/* ── Course index becomes stacked blocks, never a side-scroller ── */
@media (max-width: 860px) {
  .idx, .idx tbody, .idx tr, .idx td { display: block; width: auto; }

  .idx tbody tr.pc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 .8rem;
    padding: 1.25rem 0;
  }
  .idx tbody tr.pc > td { padding: 0; width: auto; }

  .idx td.idx__n    { order: 1; padding-top: 0; }
  .idx td.idx__lv   { order: 2; padding-top: 0; }
  .idx td.idx__go   { order: 3; padding-top: 0; margin-left: auto; }
  .idx td.idx__name { order: 4; flex: 0 0 100%; margin-top: .7rem; }
  /* full-width cell, but the copy itself still keeps a readable measure */
  .idx__name span   { max-width: 58ch; }

  .idx td.idx__dur {
    order: 5;
    width: auto;
    padding-top: 0;
    margin-top: .85rem;
    color: var(--ink-3);
  }
  .idx tbody tr.pc-det { padding: 0; }

  .pc-det .det { padding-left: 0; padding-bottom: 1.4rem; gap: 1.1rem; }
  .pc-det .det .btn { width: 100%; }
}

@media (max-width: 760px) {
  .shead { grid-template-columns: 1fr; gap: 1rem; align-items: start; }
  .prin { grid-template-columns: 1fr; }
  .prin__i, .prin__i:nth-child(even) { border-left: 0; padding-left: 0; }
  .tq { width: 100%; }
  .form__row { grid-template-columns: 1fr; }
  .team { grid-template-columns: 1fr; }
  .tm__av { aspect-ratio: 1 / 1; }
  .staff { grid-template-columns: 1fr; }
  .way { grid-template-columns: 56px minmax(0, 1fr); gap: 1rem; }
  .way__req { grid-column: 2; justify-self: start; margin-top: .8rem; }
  .route { grid-template-columns: 1fr; text-align: center; }
  .route__svg { display: none; }
}
