/* ============================================================
   RusPath — Register page redesign layer ("Admission Dossier")
   Loaded AFTER styles.css. Adds new, scoped classes only —
   nothing here redefines a global class used by other pages
   (index/login/exam/admin), so this file is safe to add without
   touching styles.css or any other page on the site.
   Uses only the color tokens already defined in :root by styles.css.
   ============================================================ */

/* ---------- Hero: two-column, with a folder-tab preview ---------- */

.dossier-hero .hero-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  align-items: center;
}
.dossier-hero .hero-copy {
  max-width: 620px;
  margin: 0;
  text-align: left;
}
.dossier-hero .hero-actions { justify-content: flex-start; }

.dossier-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
}
.dossier-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .7);
}
.dossier-metrics strong { color: var(--steel); font-size: 19px; font-weight: 600; }

.dossier-preview {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
}
.dossier-tab {
  position: absolute;
  top: calc(var(--i) * 30px);
  left: calc(var(--i) * 12px);
  right: calc(var(--i) * 12px);
  z-index: var(--i);
  height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: 10px 10px 0 0;
  color: rgba(245, 245, 242, .88);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 -6px 14px rgba(10, 27, 61, .16);
}
.dossier-tab span { font-weight: 700; color: var(--amber-soft); }
.dossier-tab:nth-of-type(1) { background: var(--steel-deep); }
.dossier-tab:nth-of-type(2) { background: var(--steel); }
.dossier-tab:nth-of-type(3) { background: var(--steel-2); }
.dossier-cover {
  position: absolute;
  top: 90px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: linear-gradient(165deg, var(--steel-deep), #16354a 55%, var(--steel));
  box-shadow: var(--shadow);
  padding: 26px 24px 20px;
  color: var(--paper);
  overflow: hidden;
}
.dossier-cover::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(245, 245, 242, .16);
  border-radius: 8px;
  pointer-events: none;
}
.dossier-cover::after {
  content: "\f19d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: -18px;
  bottom: -26px;
  font-size: 130px;
  color: rgba(245, 245, 242, .06);
  transform: rotate(-8deg);
  pointer-events: none;
}
.dossier-stamp {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  border: 2px dashed var(--amber-bright);
  border-radius: 50%;
  color: var(--amber-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  transform: rotate(-8deg);
  flex: none;
}
.dossier-cover-label { position: relative; font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 5px; }
.dossier-cover-sub { position: relative; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(245, 245, 242, .62); }

.dossier-cover-checklist {
  position: relative;
  list-style: none;
  margin: auto 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(245, 245, 242, .16);
  display: grid;
  gap: 9px;
}
.dossier-cover-checklist li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: rgba(245, 245, 242, .55);
}
.dossier-cover-checklist li i {
  width: 16px;
  font-size: 11px;
  color: rgba(245, 245, 242, .35);
}
.dossier-cover-checklist li.is-done { color: rgba(245, 245, 242, .92); }
.dossier-cover-checklist li.is-done i { color: #5fd08e; }
.dossier-cover-checklist li.is-current { color: #fff; font-weight: 600; }
.dossier-cover-checklist li.is-current i { color: var(--amber-bright); }

@media (max-width: 1060px) {
  .dossier-preview { max-width: 260px; margin: 8px auto 0; }
  .dossier-cover-sub { font-size: 9.5px; letter-spacing: .04em; overflow-wrap: normal; }
}

/* Below 660px there's no room for the full folder-cover art, but dropping
   it entirely also drops the one visual that explains "this is a 3-step
   process" before the user reads any copy. Flatten the same three tabs
   into a compact horizontal strip instead of hiding them. */
@media (max-width: 660px) {
  .dossier-hero .hero-copy { text-align: left; }
  .dossier-preview {
    position: static;
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: none;
    aspect-ratio: auto;
    margin-top: 22px;
  }
  .dossier-tab {
    position: static;
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
    border-radius: var(--radius);
    box-shadow: none;
  }
  .dossier-cover { display: none; }
}

/* ---------- Benefits: an index list, not another card grid ---------- */

.dossier-index {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 900px;
}
.dossier-index li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: padding-left .16s ease, border-color .16s ease;
}
.dossier-index li:first-child { border-top: 1px solid var(--line); }
.dossier-index li:hover { padding-left: 12px; border-left-color: var(--amber); }
.dossier-index-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1.5px solid var(--steel);
  border-radius: 50%;
  color: var(--steel);
  font-size: 15px;
}
.dossier-index h3 { margin-bottom: 6px; }
.dossier-index p { margin: 0; color: var(--ink-soft); line-height: 1.75; font-size: 13.5px; }

/* ---------- Shared "sheet" treatment for the three step cards ---------- */

.dossier-sheet { position: relative; }

/* Step counter restyled into a ticket-punch rail, no markup changes needed */
.register-step .step-indicator { gap: 12px; row-gap: 8px; }
.register-step .step-indicator .step-dot {
  width: 32px;
  height: 32px;
  font-size: 0;
  position: relative;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-strong);
}
.register-step .step-indicator .step-dot::after {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 700;
}
.register-step .step-indicator .step-dot:nth-child(1)::after { content: "1"; }
.register-step .step-indicator .step-dot:nth-child(4)::after { content: "2"; }
.register-step .step-indicator .step-dot:nth-child(7)::after { content: "3"; }
.step-indicator.step-2 .step-dot:nth-child(1)::after,
.step-indicator.step-3 .step-dot:nth-child(1)::after,
.step-indicator.step-3 .step-dot:nth-child(4)::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
}
.step-indicator.step-1 .step-dot:nth-child(1),
.step-indicator.step-2 .step-dot:nth-child(4),
.step-indicator.step-3 .step-dot:nth-child(7) {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--steel-2), 0 0 0 7px rgba(15, 86, 196, .18);
}
.register-step .step-indicator .step-line {
  height: 2px;
  background: repeating-linear-gradient(to right, var(--line-strong) 0 6px, transparent 6px 11px);
}

/* ---------- Consultation step: a call-slip ticket ---------- */

.dossier-slip .auth-brand-panel { position: relative; padding-bottom: 34px; }
.dossier-slip-preview {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding: 15px 17px;
  border: 1px dashed rgba(245, 245, 242, .35);
  border-radius: 10px;
  background: rgba(245, 245, 242, .06);
}
.dossier-slip-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--amber-bright);
  margin-bottom: 10px;
}
.dossier-slip-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(245, 245, 242, .78);
  padding: 4px 0;
  margin: 0;
}
.dossier-slip-line span { color: #fff; font-weight: 600; font-family: var(--font-mono); }

@media (min-width: 861px) {
  .dossier-slip .auth-brand-panel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    border-right: 2px dashed rgba(245, 245, 242, .22);
  }
}

/* ---------- Registration step: passport-corner photo preview ---------- */

.dossier-photo-slot { margin-top: 10px; }
.dossier-photo-slot img {
  width: 72px;
  height: 90px;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 2px 3px rgba(20, 24, 30, .1), 0 0 0 1px var(--line);
  transform: rotate(-3deg);
  border-radius: 2px;
  display: block;
}

/* ---------- Progress bar: same "paper" language as the slip/photo, no new colors ---------- */

.dossier-sheet #reg-progress .reg-progress-track {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2px;
  box-sizing: border-box;
}
.dossier-sheet #reg-progress .reg-progress-fill {
  border-radius: calc(var(--radius) - 2px);
}

/* ---------- Success panel: an approval stamp, not a plain check ---------- */

.reg-success-panel .reg-success-icon {
  background: transparent;
  border: 3px dashed var(--amber);
  color: var(--amber);
  animation: dossier-stamp-in .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes dossier-stamp-in {
  from { transform: rotate(-6deg) scale(1.6); opacity: 0; }
  to { transform: rotate(-6deg) scale(1); opacity: 1; }
}

/* ---------- One orchestrated motion: switching between the 3 steps ---------- */

.register-step:not([hidden]) { animation: dossier-step-in .38s ease both; }
@keyframes dossier-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .register-step:not([hidden]) { animation: none; }
  .reg-success-panel .reg-success-icon { animation: none; }
}

/* ============================================================
   Step 3 (Registration form): compact pass.
   Everything below is scoped to #step-register only — the Policy
   and Consultation steps are untouched. Goal: cut the form's
   vertical footprint a lot (label-beside-input instead of
   label-above-input, tighter section spacing, a side-by-side
   button row) without introducing any new color. Two matching
   HTML tweaks were needed and nothing else:
   1) the card's inline max-width went 640px -> 720px, so the
      label+input rows have room to breathe;
   2) the submit/back buttons are now wrapped in a
      ".dossier-form-actions" div so they can sit side by side.
   No IDs changed and no inputs moved, so register.js's field
   lookups and validation are unaffected.
   ============================================================ */

#step-register.register-step {
  display: block;
  min-height: 0;
  padding: 24px 0;
}

#step-register .step-indicator { margin-bottom: 12px; }
#step-register .eyebrow { margin-bottom: 4px; }
#step-register h2 { font-size: 22px; margin-bottom: 6px; }
#step-register .rich-text { font-size: 13px; line-height: 1.6; margin-bottom: 4px; }

#step-register #reg-progress { margin: 6px 0 12px; }

#step-register .register-confirm-card { padding: 22px 24px; }

#step-register .form-grid.compact { gap: 8px; margin-top: 10px; }
#step-register .form-grid.two-col.compact { gap: 10px; }

#step-register .form-section-title { margin: 14px 0 0; padding-bottom: 6px; }

/* Label-beside-input for the plain text fields only (name, tazkira,
   phone, email, country, city...) — file fields and the subject
   checklist keep their own layout, matched via :has() so nothing
   needs an extra class in the HTML. */
#step-register .field:has(> input) {
  display: grid;
  grid-template-columns: 128px 1fr;
  align-items: center;
  gap: 4px 10px;
}
#step-register .field:has(> input) > .field-hint { grid-column: 1 / -1; }

@media (max-width: 420px) {
  #step-register .field:has(> input) { grid-template-columns: 1fr; }
}

/* Subject areas: use the card's extra width instead of stacking tall */
@media (min-width: 520px) {
  #step-register .subject-checklist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Photo preview sits beside the upload control instead of pushing
   it taller once a file is picked. */
#step-register .field:has(#dossier-photo-slot) {
  display: grid;
  grid-template-columns: 1fr 44px;
  column-gap: 10px;
  align-items: start;
}
#step-register .field:has(#dossier-photo-slot) > *:not(.dossier-photo-slot) { grid-column: 1; }
#step-register .dossier-photo-slot {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  margin-top: 0;
}
#step-register .dossier-photo-slot img { width: 40px; height: 50px; border-width: 3px; }

#step-register .register-note { margin-top: 6px; }

/* Submit + Back side by side instead of two full-width stacked rows */
#step-register .dossier-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
#step-register .dossier-form-actions .primary-btn {
  flex: 1;
  width: auto;
}
#step-register .dossier-form-actions .secondary-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 18px;
}
