html { scroll-behavior: smooth; }

/* =========================================
   Контейнер секции и заголовок (единый стиль)
   ========================================= */
.faculties_layout_contact{
  display:flex; flex-direction:column; align-items:center;
  gap:30px; margin-top:16px; scroll-margin-top:96px;
}
.faculty_page_title_contact{
  color:var(--secondary); font:700 20px/1.2 Inter, sans-serif;
  text-align:center;
}

/* форма по центру внутри секции (из старого) */
.faculties_layout_contact .contact-form{
  width:min(687px,100%);
  margin:0 auto;
}

/* деталь факультета — скрыто до клика (из старого) */
.sections.faculty_detail_page #contact-form[hidden]{ display:none !important; }
/* «Абитуриентам» — всегда видно (из старого) */
.applicants_contact #contact-form{ display:block !important; }

/* =========================================
   БАЗОВАЯ ФОРМА
   ========================================= */
.contact-form{
  width:min(687px, 100%);
  background:var(--white); border-radius:8px;
  display:flex; flex-direction:column; gap:12px; padding:16px;
}
.contact-form .form_row{ width:100%; display:flex; flex-direction:column; gap:12px; }
.contact-form label{
  color:var(--secondary); font:600 14px/1 Inter, Arial, sans-serif; letter-spacing:.04em; text-align:left;
}
.contact-form input,
.contact-form textarea{
  width:100%; box-sizing:border-box;
  border:2px solid rgba(84,84,84,.15); border-radius:4px; background:var(--white);
  padding:12px 14px; outline:none;
  font:600 16px/1.2 Inter, Arial, sans-serif; color:var(--secondary);
  transition:border-color .2s, box-shadow .2s, color .2s, background-color .2s;
}
.contact-form textarea{ min-height:104px; resize:vertical; }
.contact-form input::placeholder,
.contact-form textarea::placeholder{
  color:rgba(84,84,84,.15); font-size:16px; font-weight:600;
}
.contact-form input:focus,
.contact-form textarea:focus{
  border:2px solid var(--primary); box-shadow:0 0 0 2px rgba(76,120,232,.08);
}
.contact-form input:not(:placeholder-shown),
.contact-form textarea:not(:placeholder-shown){ color:var(--primary); }

/* Ошибки */
.contact-form .field_error{
  border-color:#d93025 !important;
  box-shadow:0 0 0 2px rgba(217,48,37,.08);
}
.contact-form .field_error:focus{ box-shadow:0 0 0 2px rgba(217,48,37,.14); }

/* Кнопка отправки */
.contact-form .btn_submit{
  display:flex; justify-content:center; align-items:center; gap:10px;
  padding:10px 0; width:100%;
  border:2px solid var(--primary); border-radius:4px;
  background:var(--primary); color:var(--white); font:700 16px/1 Inter, Arial, sans-serif;
  cursor:pointer; transition:background .2s, color .2s, border-color .2s;
}
.contact-form .btn_submit .btn_icon{ width:16px; height:16px; transition:transform .2s; }
.contact-form .btn_submit:hover{ background:var(--white); color:var(--primary); border-color:var(--primary); }
.contact-form .btn_submit:hover .btn_icon{ transform:translateX(2px); content:url('../media/images/svg/arrow_right_primary.svg'); }
.contact-form .btn_submit:focus-visible{ outline:2px solid rgba(76,120,232,.6); }
.btn_submit[disabled]{ opacity:.6; cursor:default; pointer-events:none; }
.btn_submit.is_loading{ pointer-events:none; }
.btn_submit.is_loading .btn_icon{ animation:spin 700ms linear infinite; }
@keyframes spin{ from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* =========================================
   TOAST
   ========================================= */
#notice-stack{
  position:fixed; top:16px; left:50%; transform:translateX(-50%);
  display:grid; gap:12px; width:min(680px, calc(100vw - 32px)); z-index:9999;
}
.notice{
  display:flex; align-items:center; gap:10px;
  padding:12px 14px; border-radius:8px; color:var(--white);
  box-shadow:0 6px 24px rgba(0,0,0,.12);
  opacity:0; transform:translateY(-8px);
  transition:opacity .25s, transform .25s;
}
.notice.show{ opacity:1; transform:translateY(0); }
.notice_success{ background:var(--primary); }
.notice_error{ background:#d93025; }
.notice_text{ font:600 14px/1.3 Inter, Arial, sans-serif; }
.notice_close{
  margin-left:auto; border:0; background:transparent;
  color:var(--white); opacity:.8; cursor:pointer; font-size:18px; line-height:1;
}
.notice_close:hover{ opacity:1; }

/* =========================================
   ЧЕКБОКС СОГЛАСИЯ
   ========================================= */
.consent_row{ margin-top:4px; }
.consent_label{ display:flex; align-items:flex-start; gap:10px; cursor:pointer; user-select:none; }
.consent_label input{ position:absolute; opacity:0; pointer-events:none; }
.consent_box{
  width:20px; height:20px; flex:0 0 20px;
  border-radius:4px; border:2px solid rgba(84,84,84,.25);
  background:var(--white); display:inline-grid; place-items:center;
  transition:border-color .2s, background-color .2s, box-shadow .2s, transform .12s;
}
.consent_box::after{
  content:''; width:12px; height:12px;
  clip-path:polygon(14% 54%, 0 68%, 40% 100%, 100% 24%, 86% 10%, 40% 70%);
  background:var(--white); transform:scale(0) rotate(-8deg); transition:transform .18s;
}
.consent_text{ color:var(--secondary); font:600 14px/1.45 Inter, Arial, sans-serif; }
.consent_label:hover .consent_box{ border-color:var(--primary); box-shadow:0 0 0 3px rgba(76,120,232,.08); }
.consent_label input:checked + .consent_box{ background:var(--primary); border-color:var(--primary); }
.consent_label input:checked + .consent_box::after{ transform:scale(1) rotate(0); }
.consent_label input:focus-visible + .consent_box{ outline:2px solid rgba(76,120,232,.6); outline-offset:2px; }

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){
  .notice, .contact-form input, .contact-form textarea, .btn_submit,
  .btn_submit .btn_icon, .consent_box, .consent_box::after{
    transition:none !important; animation:none !important;
  }
}

/* Адаптив мелкий */
@media (max-width:360px){ .consent_text{ font-size:13px; } }
@media (max-width:347px){
  .contact-form{ padding:12px; }
  .contact-form label{ font-size:13px; }
  .contact-form input, .contact-form textarea{ padding:10px 12px; font-size:15px; }
  .contact-form .btn_submit{ font-size:15px; padding:9px 0; }
}

/* =========================================
   FILE INPUT (общий стиль для форм)
   ========================================= */
.contact-form input[type="file"],
.transfer-form input[type="file"],
.vacancy-form input[type="file"]{
  display:block; width:100%; box-sizing:border-box;
  border:2px solid rgba(84,84,84,.15); border-radius:4px; background:var(--white);
  padding:8px 10px; font:600 14px/1.2 Inter, Arial, sans-serif; color:var(--secondary);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.contact-form input[type="file"]::file-selector-button,
.transfer-form input[type="file"]::file-selector-button,
.vacancy-form  input[type="file"]::file-selector-button,
.contact-form input[type="file"]::-webkit-file-upload-button,
.transfer-form input[type="file"]::-webkit-file-upload-button,
.vacancy-form  input[type="file"]::-webkit-file-upload-button{
  display:inline-flex; justify-content:center; align-items:center; gap:8px;
  padding:10px 16px; margin-right:10px;
  border:2px solid var(--primary); border-radius:4px;
  background:var(--primary); color:var(--white); font:700 14px Inter, Arial, sans-serif;
  cursor:pointer; transition:background .2s, color .2s, border-color .2s, transform .12s, box-shadow .2s;
}
.contact-form input[type="file"]:hover::file-selector-button,
.transfer-form input[type="file"]::file-selector-button:hover,
.vacancy-form  input[type="file"]::file-selector-button:hover,
.contact-form input[type="file"]::-webkit-file-upload-button:hover,
.transfer-form input[type="file"]::-webkit-file-upload-button:hover,
.vacancy-form  input[type="file"]::-webkit-file-upload-button:hover{
  background:var(--white); color:var(--primary); border-color:var(--primary);
}
.contact-form input[type="file"]:active::file-selector-button,
.transfer-form input[type="file"]::file-selector-button:active,
.vacancy-form  input[type="file"]::file-selector-button:active,
.contact-form input[type="file"]::-webkit-file-upload-button:active,
.transfer-form input[type="file"]::-webkit-file-upload-button:active,
.vacancy-form  input[type="file"]::-webkit-file-upload-button:active{
  transform:translateY(1px); box-shadow:inset 0 2px 4px rgba(0,0,0,.1);
}

/* =========================================
   HTML5 ВАЛИДАЦИЯ
   ========================================= */
.contact-form.was-validated input:invalid,
.contact-form.was-validated textarea:invalid,
.transfer-form.was-validated input:invalid,
.transfer-form.was-validated textarea:invalid{
  border-color:#d93025 !important;
  box-shadow:0 0 0 2px rgba(217,48,37,.08);
}
.contact-form.was-validated input:invalid:focus,
.contact-form.was-validated textarea:invalid:focus,
.transfer-form.was-validated input:invalid:focus,
.transfer-form.was-validated textarea:invalid:focus{
  box-shadow:0 0 0 2px rgba(217,48,37,.14);
}
.contact-form.was-validated input[type="file"]:invalid,
.transfer-form.was-validated input[type="file"]:invalid{
  border-color:#d93025 !important;
}

/* =========================================
   ДОП. ОФОРМЛЕНИЕ ДЛЯ transfer-form (анкета)
   ========================================= */
.transfer-form{
  width:min(860px, 100%); margin:0 auto; padding:16px;
  background:var(--white); border-radius:8px;
  border:1px solid rgba(84,84,84,.12);
  box-shadow:0 8px 24px rgba(0,0,0,.06);
}
@media (max-width:360px){ .transfer-form{ padding:12px; } }
/* если заголовок рядом — убрать лишний отступ */
#transfer-form .faculty_page_title_contact{  }

.transfer-form .form_fieldset{
  border:1px solid rgba(84,84,84,.12); border-radius:8px; padding:14px; background:var(--white);
}
.transfer-form .form_fieldset + .form_fieldset{ margin-top:12px; }
.transfer-form .form_fieldset > legend{
  color:var(--light-purple); font:700 14px/1.2 Inter, Arial; padding:0 6px; background:var(--white);
}

.transfer-form .form_grid{ display:grid; gap:12px; }
.transfer-form .form_grid.two{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (max-width:760px){ .transfer-form .form_grid.two{ grid-template-columns:1fr; } }

/* RADIO кастом */
.transfer-form .radio_row{ display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.transfer-form .radio_item{
  position:relative; display:inline-flex; align-items:center; gap:8px;
  font:600 14px/1.2 Inter, Arial; color:var(--light-purple); cursor:pointer; user-select:none;
}
.transfer-form .radio_item input[type="radio"]{
  position:absolute; left:0; top:50%; width:18px; height:18px; transform:translateY(-50%);
   opacity:0; pointer-events:auto;
}
.transfer-form .radio_item span{ position:relative; padding-left:28px; }
.transfer-form .radio_item span::before{
  content:""; position:absolute; left:0; top:50%; width:18px; height:18px; transform:translateY(-50%);
  border:2px solid rgba(84,84,84,.25); border-radius:50%; background:var(--white);
  box-sizing:border-box; transition:border-color .18s, background-color .18s;
}
.transfer-form .radio_item span::after{
  content:""; position:absolute; top:50%; left:2px; width:14px; height:14px;
  transform:translateY(-50%) scale(0); border-radius:50%; background:var(--primary); transition:transform .14s ease;
}
.transfer-form .radio_item:hover span::before{ border-color:var(--primary); }
.transfer-form .radio_item input[type="radio"]:checked + span::before{ border-color:var(--primary); }
.transfer-form .radio_item input[type="radio"]:checked + span::after{ transform:translateY(-50%) scale(1); }
.transfer-form .radio_item input[type="radio"]:focus-visible + span::before{ outline:2px solid rgba(76,120,232,.6); outline-offset:2px; }
.transfer-form .radio_item input[type="radio"]:disabled + span{ opacity:.6; cursor:not-allowed; }

/* Центровки строк */
.transfer-form .row-center{ grid-column:1 / -1; justify-self:center; width:min(420px,100%); }
.transfer-form .form_row--centerY{ min-height:74px; justify-content:center; }
.consent_row--center{ align-items:center; justify-content:center; }

/* Мобильная центровка блока «Пол» */
@media (max-width:760px){
  .transfer-form .row-center{ width:100%; }
  .transfer-form .form_row--centerY{
    grid-column:1 / -1; display:flex; flex-direction:column; align-items:center; gap:8px;
  }
  .transfer-form .form_row--centerY > label{ text-align:center; }
  .transfer-form .form_row--centerY .radio_row{ justify-content:center; }
}

/* FILE как кнопка + компакт */
.transfer-form input[type="file"]::file-selector-button,
.transfer-form input[type="file"]::-webkit-file-upload-button{
  display:inline-flex; justify-content:center; align-items:center; gap:8px;
  padding:10px 16px; border:2px solid var(--primary); border-radius:4px;
  background:var(--primary); color:var(--white); font:700 14px Inter, Arial, sans-serif;
  cursor:pointer; transition:background .2s, color .2s, border-color .2s, transform .12s, box-shadow .2s;
}
.transfer-form input[type="file"]:hover::file-selector-button,
.transfer-form input[type="file"]::-webkit-file-upload-button:hover{
  background:var(--white); color:var(--primary); border-color:var(--primary);
}
.transfer-form input[type="file"]:active::file-selector-button,
.transfer-form input[type="file"]::-webkit-file-upload-button:active{
  transform:translateY(1px); box-shadow:inset 0 2px 4px rgba(0,0,0,.1);
}
@media (max-width:520px){
  .transfer-form input[type="file"]::file-selector-button,
  .transfer-form input[type="file"]::-webkit-file-upload-button{ padding:8px 12px; font-size:13px; gap:6px; }
  .transfer-form input[type="file"]{ padding:8px 10px; font-size:13px; }
}
@media (max-width:480px){
  .consent_box{ width:16px; height:16px; border-width:2px; }
  .consent_box::after{ width:10px; height:10px; }
  .transfer-form .btn_submit, .contact-form .btn_submit{ font-size:14px; padding:8px 0; }
  .transfer-form .btn_submit .btn_icon, .contact-form .btn_submit .btn_icon{ width:14px; height:14px; }
}
@media (max-width:450px){
  .transfer-form input[type="file"]::file-selector-button,
  .transfer-form input[type="file"]::-webkit-file-upload-button{ padding:7px 10px; font-size:12.5px; gap:6px; }
  .transfer-form input[type="file"]{ padding:7px 9px; font-size:12.5px; }
}
@media (max-width:360px){
  .transfer-form input[type="file"]::file-selector-button,
  .transfer-form input[type="file"]::-webkit-file-upload-button{
    padding:6px 9px; font-size:12px; gap:5px; border-width:2px;
  }
  .transfer-form input[type="file"]{ padding:6px 8px; font-size:12px; }
}
@media (max-width:320px){
  .transfer-form input[type="file"]::file-selector-button,
  .transfer-form input[type="file"]::-webkit-file-upload-button{ padding:6px 8px; font-size:11.5px; gap:4px; }
  .transfer-form input[type="file"]{ padding:6px 7px; font-size:11.5px; }
}
