/* ============================================================
   FREE NCIE — Login / Registration
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: #37474F;
  background: #D9E3EE;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ════════════════════════════════════════
   LANGUAGE FLAGS
   ════════════════════════════════════════ */
.lang-flags {
  position: fixed;
  top: 12px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1000;
}
.flag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  border: 2.5px solid #fff;
  transition: transform .18s;
  display: none;
}
.flag.active         { display: block; }
.lang-flags:hover .flag { display: block; }
.flag:hover          { transform: scale(1.1); }

/* ════════════════════════════════════════
   SCREEN LAYER
   ════════════════════════════════════════ */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.screen.active { display: flex; }

/* ════════════════════════════════════════
   CARD
   ════════════════════════════════════════ */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 50, 110, .13);
  padding: 44px 52px 48px;
  width: 100%;
  max-width: 400px;
}
.card-white {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 50, 110, .13);
  padding: 40px 48px;
  width: 100%;
  max-width: 440px;
}

/* ════════════════════════════════════════
   LOGO
   ════════════════════════════════════════ */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 30px;
}
.logo-text {
  font-size: 32px;
  font-weight: 700;
  color: #0076C0;
  letter-spacing: 1px;
  line-height: 1;
}

/* ════════════════════════════════════════
   SCREEN TITLE
   ════════════════════════════════════════ */
.screen-title {
  font-size: 14px;
  font-weight: 600;
  color: #546E7A;
  text-align: center;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

/* ════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  pointer-events: none;
  z-index: 1;
}
.input-field {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1.5px solid #DDE8F0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #37474F;
  background: #EDF3F8;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
}
.input-field.plain        { padding: 0 14px; }
.input-field::placeholder { color: #9EAAB4; font-size: 13px; }
.input-field:focus {
  border-color: #0076C0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,118,192,.10);
}
.input-field.error-border { border-color: #E53935 !important; }

/* Select */
.select-wrap  { position: relative; }
.select-arrow {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.select-field {
  width: 100%;
  height: 46px;
  padding: 0 38px 0 14px;
  border: 1.5px solid #DDE8F0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #37474F;
  background: #EDF3F8;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.select-field:focus { border-color: #0076C0; background: #fff; }

/* Label */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #78909C;
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.field-label.required::after { content: ' *'; color: #E53935; }

/* Error */
.error-msg {
  color: #E53935;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Info text */
.info-text {
  font-size: 13px;
  color: #78909C;
  text-align: center;
  line-height: 1.65;
  margin-bottom: 16px;
}

/* Forgot link */
.forgot-link     { text-align: right; margin-top: 6px; }
.forgot-link a   { font-size: 12px; color: #0076C0; text-decoration: none; }
.forgot-link a:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.btn-primary {
  display: block;
  width: 100%;
  height: 46px;
  background: #0055A4;
  color: #fff;
  border: none;
  border-radius: 23px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .4px;
  cursor: pointer;
  transition: background .18s, box-shadow .18s;
  margin-top: 8px;
}
.btn-primary:hover  { background: #004490; box-shadow: 0 4px 16px rgba(0,68,144,.25); }
.btn-primary:active { background: #003070; }

.btn-light-blue       { background: #0076C0; }
.btn-light-blue:hover { background: #005fa3; }

.btn-disabled {
  background: #CFD8DC !important;
  color: #90A4AE !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.link-center         { text-align: center; margin-top: 18px; font-size: 13.5px; }
.link-center a       { color: #0076C0; text-decoration: none; font-weight: 500; }
.link-center a:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   CHECKBOX
   ════════════════════════════════════════ */
.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #546E7A;
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-wrap input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #0076C0;
  cursor: pointer;
}
.checkbox-wrap a       { color: #0076C0; text-decoration: none; }
.checkbox-wrap a:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   INFO BANNER
   ════════════════════════════════════════ */
.info-banner {
  background: #EAF4FC;
  border-left: 4px solid #0076C0;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #37474F;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ════════════════════════════════════════
   CUSTOM DROPDOWN
   ════════════════════════════════════════ */
.custom-select-wrap { position: relative; }
.custom-select-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #DDE8F0;
  border-radius: 8px;
  background: #EDF3F8;
  cursor: pointer;
  font-size: 14px;
  color: #37474F;
  transition: border-color .15s;
}
.custom-select-box:hover { border-color: #90CAF9; }
.custom-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #DDE8F0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,50,110,.15);
  z-index: 500;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 280px;
  display: flex;
  flex-direction: column;
}
.dropdown-search-wrap {
  position: relative;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #F0F4F8;
  flex-shrink: 0;
}
.dropdown-search {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1.5px solid #DDE8F0;
  border-radius: 6px;
  font-size: 13px;
  background: #F5F8FA;
  outline: none;
  font-family: inherit;
}
.dropdown-search:focus { border-color: #0076C0; }
.search-icon { position: absolute; right: 20px; top: 18px; pointer-events: none; }
.dropdown-list { overflow-y: auto; flex: 1; }
.dropdown-item {
  padding: 11px 16px;
  font-size: 13.5px;
  color: #37474F;
  cursor: pointer;
  transition: background .12s;
}
.dropdown-item:hover { background: #EAF4FC; color: #0076C0; }

/* ════════════════════════════════════════
   CONTINGENT LIST
   ════════════════════════════════════════ */
.contingent-item {
  padding: 10px 16px;
  font-size: 13.5px;
  color: #37474F;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.contingent-item:hover { background: #EAF4FC; color: #0076C0; }
.contingent-item.parent {
  font-weight: 600;
  color: #546E7A;
  background: #F5F8FA;
  border-bottom: 1px solid #F0F4F8;
  cursor: default;
}
.contingent-item.parent:hover { background: #EDF3F8; }
.contingent-item.child {
  padding-left: 28px;
  font-size: 13px;
}
.contingent-arrow { font-size: 11px; color: #90A4AE; }

/* ════════════════════════════════════════
   DATE PICKER — ИСПРАВЛЕНО
   ════════════════════════════════════════ */
.date-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.date-input-wrap .input-field {
  padding-right: 40px;
  cursor: pointer;
}
.date-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  cursor: pointer;
  z-index: 2;
  opacity: 0.65;
  transition: opacity .15s;
  flex-shrink: 0;
  pointer-events: all;
}
.date-icon:hover { opacity: 1; }

/* Попап календаря */
.calendar-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 290px;
  background: #fff;
  border: 1.5px solid #DDE8F0;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,50,110,.15);
  z-index: 600;
  padding: 14px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* === ИСПРАВЛЕНИЕ: стили для кликабельных span в заголовке === */
.cal-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a2b4a;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.cal-header-title span {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  user-select: none;
}

.cal-header-title span:hover {
  background: #EAF4FC;
  color: #0076C0;
}

.cal-year-range {
  font-size: 14px;
  font-weight: 600;
  color: #1a2b4a;
  padding: 4px 8px;
}

.cal-nav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #90A4AE;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.cal-nav:hover { background: #EAF4FC; color: #0076C0; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.cal-weekdays div {
  text-align: center;
  font-size: 11px;
  color: #90A4AE;
  font-weight: 500;
  padding: 4px 0;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  color: #37474F;
  transition: background .12s, color .12s;
  user-select: none;
}
.cal-day:hover        { background: #EAF4FC; color: #0076C0; }
.cal-day.today        { border: 2px solid #0076C0; font-weight: 700; }
.cal-day.selected     { background: #0076C0; color: #fff; font-weight: 600; }
.cal-day.other-month  { color: #CFD8DC; }
.cal-day.other-month:hover { background: transparent; color: #90A4AE; }

/* === Сетка для месяцев и годов === */
.cal-months, .cal-years {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 0;
}

.cal-month-item, .cal-year-item {
  padding: 10px 4px;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #37474F;
  transition: background .12s, color .12s;
  user-select: none;
}

.cal-month-item:hover,
.cal-year-item:not(.disabled):hover {
  background: #EAF4FC;
  color: #0076C0;
}

.cal-month-item.selected,
.cal-year-item.selected {
  background: #0076C0;
  color: #fff;
  font-weight: 600;
}

.cal-year-item.disabled {
  color: #CFD8DC;
  cursor: not-allowed;
}

.cal-year-item.disabled:hover {
  background: transparent;
}

.cal-today-btn {
  text-align: center;
  margin-top: 10px;
  padding: 7px;
  color: #0076C0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  transition: background .15s;
}
.cal-today-btn:hover { background: #EAF4FC; }

/* ════════════════════════════════════════
   WORKPLACE WRAP
   ════════════════════════════════════════ */
.workplace-wrap .custom-dropdown { max-height: 240px; }

/* ════════════════════════════════════════
   STEP DOTS
   ════════════════════════════════════════ */
.step-indicator { display: flex; justify-content: center; gap: 7px; margin-bottom: 22px; }
.step-dot       { width: 8px; height: 8px; border-radius: 50%; background: #CFD8DC; }
.step-dot.active{ background: #0076C0; }

/* ════════════════════════════════════════
   SUCCESS SCREEN
   ════════════════════════════════════════ */
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #E8F5E9;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.success-title { font-size: 18px; font-weight: 700; color: #37474F; text-align: center; margin-bottom: 8px; }
.success-text  { font-size: 13.5px; color: #78909C; text-align: center; margin-bottom: 24px; line-height: 1.6; }

/* ════════════════════════════════════════
   PASS TOGGLE
   ════════════════════════════════════════ */
.pass-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #90A4AE;
  display: flex;
  align-items: center;
}

/* ════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════ */
@media (max-width: 480px) {
  .card, .card-white {
    padding: 30px 22px 36px;
    border-radius: 12px;
  }
  .logo-text { font-size: 28px; }
  .btn-primary { height: 44px; font-size: 14px; }
  .calendar-popup { width: calc(100vw - 40px); }
}