.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 14, 24, 0.8);
  }
  
  .popup-content {
    background-color: var(--color-surface);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .close-popup {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 38px;
    font-weight: 300;
    color: var(--color-text);
    cursor: pointer;
    border: none;
    background: none;
    z-index: 10;
    font-family: inherit;
  }
  
  #thankYouMessage .close-popup {
    color: var(--color-text-inverse);
  }
  
  .popup h2 {
    margin-bottom: 30px;
    font-size: 24px;
    color: var(--color-text);
    font-weight: 600;
  }
  
  .form-group {
    margin-bottom: 20px;
    position: relative;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--color-text-muted);
  }
  
  .form-group input {
    width: 100%;
    border: none;
    padding-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    background-color: transparent;
    font-family: inherit;
  }
  
  /* #ccc намеренно оставлен литералом (5.3f): ближайшая ступень шкалы
     --color-border-mid (#e0e0e0) светлее, а это единственный указатель поля. */
  .form-group::after {
    content: '';
    position: absolute;
    left: -30px;
    right: -30px;
    bottom: 0;
    height: 1px;
    background-color: #ccc;
  }
  
  .form-group input:focus {
    outline: none;
  }
  
  /* Подсветка нижней линии сфокусированного поля. Была задумана изначально, но
     не работала: `input:focus ~ .form-group::after` искал соседа input'а, тогда
     как input лежит внутри `.form-group` и линию рисует `::after` того же
     родителя. Нужен предок, а не сосед: у телефона input вложен ещё и в
     `.phone-input-wrapper`. Утолщение — потому что 1px одним цветом слишком
     тихо (среди клиентов есть пожилые); раскладку не двигает, `::after`
     позиционирован абсолютно. */
  .form-group:focus-within::after {
    height: 2px;
    background-color: #4C5FD5;
  }
  
  .phone-group .phone-input-wrapper {
    display: flex;
    align-items: center;
    font-family: inherit; 
  }
  
  .phone-group .phone-prefix {
    font-size: 16px;
    color: var(--color-text);
    margin-right: 5px;
    padding-bottom: 15px;
    flex-shrink: 0;
    font-family: inherit; 
  }
  
  .phone-group input {
    flex-grow: 1;
    border: none;
    padding-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    background-color: transparent;
    font-family: inherit; 
  }
  
  /* Подсказка сейчас пустая (placeholder=""), поэтому цвет ничего не рисует;
     ступень выбрана та, что прошла бы порог 4,5:1, если текст туда вернут. */
  .phone-group input::placeholder {
    color: var(--color-text-muted);
    font-family: inherit; 
  }
  
  .submit-button {
    background-color: #3C3CF5;
    color: var(--color-text-inverse);
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
  }
  
  .submit-button span {
    margin-right: 8px;
  }
  
  .submit-button svg {
    width: 20px;
    height: 20px;
  }
  
  .submit-button:hover {
    background-color: #3A4BB7;
  }
  
  /* Строка согласия под кнопкой отправки (чора C33). Намеренно тише и кнопки,
     и запасного номера: это юридическая сноска, а не третий призыв. Кегль
     13px — тот же, что у подписи над номером; ниже не опускаю, среди клиентов
     есть пожилые. Ссылка подчёркнута всегда: она стоит внутри абзаца, и одним
     цветом её от обычного текста не отличить. */
  .popup-consent {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-muted);
  }

  .popup-consent a {
    color: var(--color-navy);
    text-decoration: underline;
  }

  .popup-consent a:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Запасной путь для тех, кому проще позвонить, чем заполнять форму.
     Намеренно тише синей кнопки: это альтернатива, а не второй призыв.
     Номер крупный и с запасом по площади нажатия — среди клиентов есть
     пожилые люди. */
  .popup-direct-call {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--color-text);
  }

  .popup-direct-call span {
    display: block;
  }

  .popup-direct-call a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-navy);
    text-decoration: none;
    white-space: nowrap;
  }

  .popup-direct-call a svg {
    width: 16px;
    height: 16px;
    flex: none;
  }

  .popup-direct-call a:hover {
    text-decoration: underline;
  }

  .popup-direct-call a:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
    border-radius: 6px;
  }

  #callbackFormContainer {
    position: relative;
  }
  
  #thankYouMessage {
    position: absolute;
    border-radius: 20px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3C3CF5;
    color: var(--color-text-inverse);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: left;
    text-align: left;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  #thankYouMessage.visible {
    opacity: 1;
    visibility: visible;
  }
  
  #thankYouMessage h2 {
    font-size: clamp(24px, 10vw, 58px);
    margin-top: 80px;
    margin-bottom: 20px;  /* Уменьшим отступ снизу */
    color: var(--color-text-inverse);
    width: 100%;
    word-wrap: normal;
    line-height: 1.2;
  }
  
  /* Чёрный вне серой шкалы: линия лежит на синем экране благодарности (5.3f). */
  .black-line {
    width: calc(100% + 60px);  /* 100% ширины + отступы слева и справа */
    height: 1px;  /* Толщина линии */
    background-color: #000;
    margin: 0 -30px 20px -30px;  /* Отрицательные отступы, чтобы линия выходила за пределы padding */
  }
  
  #thankYouMessage p {
    font-size: 18px;
    margin-top: 20px;  /* Добавим отступ сверху */
  }
  
  /* Тот же #ccc: ступени под «выключенную поверхность» в шкале нет (5.3f). */
  .submit-button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
  }
  
  .submit-button.disabled:hover {
    background-color: #ccc;
  }
  
  .form-group input:invalid {
    border-bottom: 1px solid #ff0000;
  }
  
  .form-group input:valid {
    border-bottom: 1px solid #00ff00;
  }
  
  .thank-you-message {
    text-align: center;
    padding: 20px;
  }
  
  .success-icon {
    color: #4CAF50;
    font-size: 48px;
    margin-bottom: 15px;
  }
  
  .thank-you-message h3 {
    color: var(--color-text);
    margin-bottom: 10px;
  }
  
  .thank-you-message p {
    color: var(--color-text-muted);
  }