/* ====== БАЗА ====== */
:root{
  --bg: #0a0a0a;
  --card: #111;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --input-bg:#0f0f0f;
  --input-stroke:#2a2a2a;
  --input-stroke-focus:#3a3a3a;
}

.modal{
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  padding: 24px;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 1000;
}
.modal[aria-hidden="true"]{
  opacity: 0; visibility: hidden; pointer-events: none;
}


/* ====== КАРТОЧКА ====== */
.modal__card{
  width: min(560px, 100%);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  padding: 22px 22px 20px;
  position: relative;
  transform: translateY(6px);
  transition: transform .25s ease, opacity .25s ease;
  opacity: 1;
}
.modal[aria-hidden="true"] .modal__card{
  transform: translateY(12px); opacity: 0;
}

/* ====== КНОПКА ЗАКРЫТЬ ====== */
.close{
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px; line-height: 1;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .15s ease;
}
.close:hover{ color:#fff; border-color:#444; background:#151515; transform: scale(1.02); }
.close:active{ transform: scale(.98); }

/* ====== ЗАГОЛОВОК ====== */
#mTitle{
  margin: 8px 0 8px;
  font-size: 22px; font-weight: 700; letter-spacing: .2px;
  color: white;
}

/* ====== ТЕКСТ ====== */
.modal__card p{
  margin: 0 0 12px; color: var(--muted); line-height: 1.5;
}

/* ====== ТЕЛЕФОН (ВВЕРХУ) + РАЗДЕЛИТЕЛЬ ====== */
.phone{
  font-size: 24px; font-weight: 800; letter-spacing: .5px;
  padding: 10px 0 16px;
  color: white;
}
.phone::after{
  content:"";
  display:block;
  height:1px; width:100%;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin-top: 12px;
}

/* ====== ФОРМА ====== */
.f{
  display: grid; gap: 14px;
  margin-top: 16px;
}
.f > div{
  display: grid; gap: 8px;
}

.f label{
  font-size: 13px; color: var(--muted);
}

.f input{
  appearance: none;
  background: var(--input-bg);
  color: white;
  border: 1px solid var(--input-stroke);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.f input::placeholder{ color:#6d6d6d; }
.f input:focus{
  border-color: var(--input-stroke-focus);
  box-shadow: 0 0 0 6px rgba(255,255,255,.04);
}

/* ====== КНОПКА ОТПРАВКИ ====== */
.f button[type="submit"]{
  margin-top: 6px;
  width: 100%;
  border: 1px solid #fff;
  background: #fff;
  color: #000;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.f button[type="submit"]:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255,255,255,.08);
}
.f button[type="submit"]:active{
  transform: translateY(0);
}

/* ====== ПРИМЕЧАНИЕ ====== */
.f small{
  display:block; margin-top: 8px; color: var(--muted);
}

/* ====== АДАПТИВ ====== */
@media (min-width: 560px){
  .f{
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: row;
  }
  .f > div:nth-child(1),
  .f > div:nth-child(2){ grid-column: span 1; }
  .f button[type="submit"],
  .f small{ grid-column: 1 / -1; }
}

/* ====== ДОСТУПНОСТЬ ====== */
:focus-visible{
  outline: 2px dashed #fff; outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce){
  .modal, .modal__card, .close, .f button[type="submit"]{ transition: none !important; }
}
