/* =============================================================================
   PROFILE-MODAL — модалка профиля + login flow.
   Опирается на .modal-back / .modal из styles/misc.css. Узкая (480px),
   разделена на info-block + 1-2 form-section'а с заголовками.
   ========================================================================= */

.profile-modal {
  max-width: 480px;
  padding: 18px 20px;
}

.profile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
}
.profile-head h2 {
  margin: 0;
  font-size: 17px;
}
.profile-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}
.profile-close:hover { color: var(--text); }

/* Info rows: компактный info-card. */
.profile-rows {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--r-md, 8px);
  background: rgba(0,0,0,0.18);
  margin: 0 0 16px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 12.5px;
}
.profile-row .k { color: var(--muted); }
.profile-row .v { color: var(--text); text-align: right; word-break: break-word; }
.profile-pid {
  font-family: ui-monospace, "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px;
  opacity: 0.85;
}
.profile-login-set   { color: #b6efd2; font-weight: 600; }
.profile-login-empty { color: #d9a062; font-style: italic; }

/* Section: задача / форма. */
.profile-section {
  margin: 0 0 14px;
}
.profile-section:last-child { margin-bottom: 0; }
.profile-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 0 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-2, rgba(255,255,255,0.06));
}
.profile-section:first-of-type .profile-section-title {
  padding-top: 0;
  border-top: none;
}
.profile-section-lead {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 10px;
}
.profile-warn {
  color: #ffb89a;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-field-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.profile-field input[type="text"],
.profile-field input[type="password"] {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--r-sm, 6px);
  border: 1px solid var(--border-2, rgba(255,255,255,0.1));
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.profile-field input:focus {
  border-color: rgba(110,180,160,0.55);
  background: rgba(0,0,0,0.35);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.profile-switch-section .profile-section-lead { margin-bottom: 6px; }
.profile-switch-btn {
  width: 100%;
  text-align: left;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .profile-modal {
    width: min(480px, calc(100vw - 16px));
    padding: 14px 14px;
  }

  /* Крестик: тап-таргет 44px */
  .profile-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
  }

  /* Кнопки действий: не теснятся */
  .profile-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .profile-actions .btn {
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .profile-modal {
    padding: 12px 10px;
  }
  .profile-rows {
    padding: 8px 10px;
  }
}
